1800
How can I highlight somehow the child bars of a summary bar

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	with Chart do
	begin
		PaneWidth[False] := 128;
		FirstVisibleDate := '1/1/2001';
		Bars.Item['Task'].Color := $f0f0f0;
	end;
	with Items do
	begin
		hSummary := AddItem('Summary');
		AddBar(hSummary,'Project Summary','1/2/2001','1/2/2001','',Null);
		hTask := InsertItem(hSummary,Null,'Task A');
		AddBar(hTask,'Task','1/2/2001','1/5/2001','K1',Null);
		hTask := InsertItem(hSummary,Null,'Task B');
		AddBar(hTask,'Task','1/4/2001','1/8/2001','K2',Null);
		hTask := InsertItem(hSummary,Null,'Task C');
		AddBar(hTask,'Task','1/6/2001','1/10/2001','K3',Null);
		ExpandItem[hSummary] := True;
		DefineSummaryBars(hSummary,'',-1,'<*>');
		ItemBar[hSummary,'',EXG2ANTTLib_TLB.exSummaryBarBackColor] := OleVariant(65536);
		ItemBar[hSummary,'',EXG2ANTTLib_TLB.exSummaryBarBackColorTransparent] := OleVariant(50);
	end;
	EndUpdate();
end
1799
How do I change the color for the selected bars, without showing the frame arround

with G2antt1 do
begin
	BeginUpdate();
	with Chart do
	begin
		FirstVisibleDate := '1/1/2002';
		SelBarColor := $7f0000ff;
		PaneWidth[False] := 48;
	end;
	Columns.Add('Task');
	with Items do
	begin
		AddBar(AddItem('Task 1'),'Task','1/2/2002','1/4/2002','A',Null);
		AddBar(AddItem('Task 2'),'Task','1/6/2002','1/10/2002','B',Null);
		AddBar(AddItem('Task 3'),'Task','1/11/2002','1/14/2002','C',Null);
		ItemBar[0,'<A B>',EXG2ANTTLib_TLB.exBarSelected] := OleVariant(True);
	end;
	EndUpdate();
end
1798
Is it possible to enumerate the activities/bars of critical path

// BarResize event - Occurs when a bar is moved or resized.
procedure TForm1.G2antt1BarResize(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
	with G2antt1 do
	begin
		Items.SchedulePDM(Item,OleVariant(Key));
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with Chart do
	begin
		LevelCount := 2;
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 96;
		Bars.Item['Task'].Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=int(%269) > 0 ? (`<b>` + %269 + `</b>`) : ``%>';
	end;
	with Items do
	begin
		hSummary1 := AddItem('Summary');
		ItemBold[hSummary1] := True;
		AddBar(hSummary1,'Summary','1/2/2001','1/2/2001','sum',Null);
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/4/2001',Null,Null);
		DefineSummaryBars(hSummary1,'sum',h1,'');
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/2/2001','1/4/2001',Null,Null);
		DefineSummaryBars(hSummary1,'sum',h2,'');
		AddLink('L1',h1,'',h2,'');
		h3 := AddItem('Task 3');
		AddBar(h3,'Task','1/2/2001','1/4/2001',Null,Null);
		DefineSummaryBars(hSummary1,'sum',h3,'');
		AddLink('L2',h2,'',h3,'');
		h4 := AddItem('Task 4');
		AddBar(h4,'Task','1/2/2001','1/4/2001',Null,Null);
		DefineSummaryBars(hSummary1,'sum',h4,'');
		AddLink('L3',h1,'',h4,'');
		DefSchedulePDM[EXG2ANTTLib_TLB.exPDMCriticalPathBarColor] := OleVariant(65280);
		SchedulePDM(h1,'');
	end;
	EndUpdate();
end
1797
How can I add a SF link

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '12/25/2000';
		PaneWidth[False] := 48;
		LevelCount := 2;
	end;
	with Items do
	begin
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/2/2001','1/5/2001','K2',Null);
		h3 := AddItem('Task 3');
		AddBar(h3,'Task','1/2/2001','1/5/2001','K3',Null);
		h4 := AddItem('Task 4');
		AddBar(h4,'Task','1/2/2001','1/5/2001','K4',Null);
		h5 := AddItem('Task 5');
		AddBar(h5,'Task','1/2/2001','1/5/2001','K5',Null);
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		AddLink('L3',h3,'K3',h4,'K4');
		AddLink('L4',h4,'K4',h5,'K5');
		Link['L4',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(0);
		Link['L4',EXG2ANTTLib_TLB.exLinkEndPos] := OleVariant(2);
		Link['L4',EXG2ANTTLib_TLB.exLinkColor] := OleVariant(65280);
		SchedulePDM(0,'K5');
	end;
	Chart.ShowLinks := EXG2ANTTLib_TLB.exShowExtendedLinks;
	EndUpdate();
end
1796
How do I get the Start and End date of a bar

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	Debug := True;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		LevelCount := 2;
		PaneWidth[False] := 96;
	end;
	with Items do
	begin
		AddBar(AddItem('Task 1'),'Task','9/21/2006','9/24/2006','K1',Null);
		AddBar(AddItem('Task 2'),'Task','9/22/2006','9/25/2006','K2',Null);
		AddBar(AddItem('Task 3'),'Task','9/23/2006','9/26/2006','K3',Null);
		h := ItemByIndex[1];
		ItemBold[h] := True;
		OutputDebugString( 'Start of ' );
		OutputDebugString( FirstItemBar[h] );
		OutputDebugString( ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarStart] );
		OutputDebugString( 'End of  ' );
		OutputDebugString( FirstItemBar[h] );
		OutputDebugString( ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarEnd] );
	end;
	EndUpdate();
end
1795
I haven't found options to change/localize (in German, or my current regional settings) the captions/text/strings ( dates, tooltip ) that shows in the chart area (method 2)

with G2antt1 do
begin
	with Chart do
	begin
		FirstWeekDay := LocFirstWeekDay;
		MonthNames := LocMonthNames;
		WeekDays := LocWeekDays;
		AMPM := LocAMPM;
		LevelCount := 2;
		PaneWidth[False] := 0;
		UnitScale := EXG2ANTTLib_TLB.exDay;
	end;
end
1794
Is it possible to change caption of the print and print preview, as it just says "Untitled Document", but I cant find the code that writes this caption

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	Chart.FirstVisibleDate := '1/1/2001';
	with Items do
	begin
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
		AddLink('L1',h1,'K1',h2,'K2');
	end;
	EndUpdate();
	with (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.Print'))) as EXPRINTLib_TLB.Print) do
	begin
		Caption := 'This is your new caption for print and print preview';
		AutoRelease := False;
		PrintExt := (IUnknown(G2antt1.DefaultInterface) as EXG2ANTTLib_TLB.G2antt);
		Preview();
	end;
end
1793
Is it possible to specify the A4 paper size for the print preview
with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	Chart.FirstVisibleDate := '1/1/2001';
	with Items do
	begin
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
		AddLink('L1',h1,'K1',h2,'K2');
	end;
	EndUpdate();
	with (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.Print'))) as EXPRINTLib_TLB.Print) do
	begin
		Settings[0] := OleVariant(9);
		AutoRelease := False;
		PrintExt := (IUnknown(G2antt1.DefaultInterface) as EXG2ANTTLib_TLB.G2antt);
		Preview();
	end;
end
1792
Is it possible to tell the print preview to open up in "landscape mode" by default, not in "portrait mode"
with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	Chart.FirstVisibleDate := '1/1/2001';
	with Items do
	begin
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
		AddLink('L1',h1,'K1',h2,'K2');
	end;
	EndUpdate();
	with (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.Print'))) as EXPRINTLib_TLB.Print) do
	begin
		PageOrientation := 2;
		AutoRelease := False;
		PrintExt := (IUnknown(G2antt1.DefaultInterface) as EXG2ANTTLib_TLB.G2antt);
		Preview();
	end;
end
1791
How do I prevent a caption outside the bar from overlapping other bars

with G2antt1 do
begin
	BeginUpdate();
	ScrollBySingleLine := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 48;
		Bars.Copy('Task','Default-Task');
		Bars.Item['Task'].OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsIncludeCaption) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack);
	end;
	with Items do
	begin
		h := AddItem('Task 1');
		AddBar(h,'Task','1/2/2001','1/4/2001','A1','task');
		ItemBar[h,'A1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
		AddBar(h,'Task','1/6/2001','1/10/2001','A2','task');
		ItemBar[h,'A2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(16);
		h := AddItem('Task 2');
		AddBar(h,'Default-Task','1/2/2001','1/4/2001','A1','task');
		ItemBar[h,'A1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
		AddBar(h,'Default-Task','1/6/2001','1/10/2001','A2','task');
		ItemBar[h,'A2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(16);
	end;
	EndUpdate();
end
1790
How do I clip/hide/align the bar's extra-caption/text based on the bar's size/width/length

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Clip');
	ScrollBySingleLine := True;
	DrawGridLines := EXG2ANTTLib_TLB.exRowLines;
	with Chart do
	begin
		AllowResizeChart := Integer(EXG2ANTTLib_TLB.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartHeader);
		DrawGridLines := EXG2ANTTLib_TLB.exRowLines;
		FirstVisibleDate := '12/23/2000';
		LevelCount := 2;
		PaneWidth[False] := 216;
		with Bars.Item['Task'] do
		begin
			Pattern := EXG2ANTTLib_TLB.exPatternBox;
			Color := $a4a4a4;
			StartColor := $f0f0f0;
			EndColor := StartColor;
			OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsIncludeCaption) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack);
			Height := 15;
		end;
		MinUnitWidth := UnitWidth;
	end;
	with Items do
	begin
		h := AddItem('no clip, (0-2)');
		AddBar(h,'Task','1/2/2001','1/4/2001','K1',Null);
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, right(<b>2</b>)';
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(2);
		AddBar(h,'Task','1/2/2001','1/4/2001','K2',Null);
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, center(<b>1</b>)';
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(1);
		AddBar(h,'Task','1/2/2001','1/4/2001','K3','');
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, left(<b>0</b>)';
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(0);
		h := AddItem('clip, inside (3-5)');
		AddBar(h,'Task','12/28/2000','1/8/2001','K1',Null);
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'clip, inside, right(<b>5</b>)';
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(5);
		AddBar(h,'Task','12/28/2000','1/8/2001','K2',Null);
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'clip, inside, center(<b>4</b>)';
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(4);
		AddBar(h,'Task','12/28/2000','1/8/2001','K3',Null);
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaption] := 'clip, inside, left(<b>3</b>)';
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(3);
		h := AddItem('hide on min width, clip if not fit, inside (6-8)');
		AddBar(h,'Task','12/26/2000','1/10/2001','K1',Null);
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'hide on min width, clip if not fit, inside, right(<b>8</b>)';
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(8);
		AddBar(h,'Task','12/26/2000','1/10/2001','K2',Null);
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'hide on min width, clip if not fit, inside, center(<b>7</b>)';
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(7);
		AddBar(h,'Task','12/26/2000','1/10/2001','K3',Null);
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaption] := 'hide on min width, clip if not fit, inside, left(<b>6</b>)';
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(6);
		h := AddItem('hide if not fit, no clip, inside (9-11)');
		AddBar(h,'Task','12/28/2000','1/8/2001','K1',Null);
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'hide if not fit, no clip, inside, right(<b>11</b>)';
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(11);
		AddBar(h,'Task','12/28/2000','1/8/2001','K2',Null);
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'hide if not fit, no clip, center(<b>10</b>)';
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(10);
		AddBar(h,'Task','12/28/2000','1/8/2001','K3',Null);
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaption] := 'hide if not fit, no clip, inside, left(<b>9</b>)';
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(9);
		h := AddItem('no clip, inside, outside (12-14)');
		AddBar(h,'Task','12/28/2000','1/8/2001','K1',Null);
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, inside, outside, right(<b>14</b>)';
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(14);
		AddBar(h,'Task','12/28/2000','1/8/2001','K2',Null);
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, inside, outside, center(<b>13</b>)';
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(13);
		AddBar(h,'Task','12/28/2000','1/8/2001','K3',Null);
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, inside, outside, left(<b>12</b>)';
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(12);
		h := AddItem('no clip, outside (16-18)');
		AddBar(h,'Task','12/30/2000','1/6/2001','K1',Null);
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, outside, right(<b>18</b>)';
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(18);
		AddBar(h,'Task','12/30/2000','1/6/2001','K2',Null);
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, outside, center(<b>17</b>)';
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(17);
		AddBar(h,'Task','12/30/2000','1/6/2001','K3',Null);
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaption] := 'no clip, outside, left(<b>16</b>)';
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(16);
	end;
	EndUpdate();
end
1789
What options do I have to show the links between bars (rectangular SEV, starts vertically, ends vertically)

with G2antt1 do
begin
	BeginUpdate();
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 128;
		NonworkingDays := 0;
		LinksWidth := 2;
	end;
	with Items do
	begin
		AddItem('');
		h3 := AddItem('Task 3');
		AddItem('');
		AddBar(h3,'Task','1/13/2001','1/15/2001','K3',Null);
		h1 := AddItem('Task 1');
		AddItem('');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/7/2001','1/9/2001','K2',Null);
		AddItem('');
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['<*>',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(5);
	end;
	EndUpdate();
end
1788
What options do I have to show the links between bars (rectangular SV, starts vertically, ends horizontally)

with G2antt1 do
begin
	BeginUpdate();
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 128;
		NonworkingDays := 0;
		LinksWidth := 2;
	end;
	with Items do
	begin
		AddItem('');
		h3 := AddItem('Task 3');
		AddItem('');
		AddBar(h3,'Task','1/13/2001','1/15/2001','K3',Null);
		h1 := AddItem('Task 1');
		AddItem('');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/7/2001','1/9/2001','K2',Null);
		AddItem('');
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['<*>',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(4);
	end;
	EndUpdate();
end
1787
What options do I have to show the links between bars (rectangular EV, starts horizontally, ends vertically)

with G2antt1 do
begin
	BeginUpdate();
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 128;
		NonworkingDays := 0;
		LinksWidth := 2;
	end;
	with Items do
	begin
		AddItem('');
		h3 := AddItem('Task 3');
		AddItem('');
		AddBar(h3,'Task','1/13/2001','1/15/2001','K3',Null);
		h1 := AddItem('Task 1');
		AddItem('');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/7/2001','1/9/2001','K2',Null);
		AddItem('');
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['<*>',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(3);
	end;
	EndUpdate();
end
1786
What options do I have to show the links between bars (straight)

with G2antt1 do
begin
	BeginUpdate();
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 128;
		NonworkingDays := 0;
		LinksWidth := 2;
	end;
	with Items do
	begin
		AddItem('');
		h3 := AddItem('Task 3');
		AddItem('');
		AddBar(h3,'Task','1/13/2001','1/15/2001','K3',Null);
		h1 := AddItem('Task 1');
		AddItem('');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/7/2001','1/9/2001','K2',Null);
		AddItem('');
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['<*>',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(2);
	end;
	EndUpdate();
end
1785
What options do I have to show the links between bars (direct)

with G2antt1 do
begin
	BeginUpdate();
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 128;
		NonworkingDays := 0;
		LinksWidth := 2;
	end;
	with Items do
	begin
		AddItem('');
		h3 := AddItem('Task 3');
		AddItem('');
		AddBar(h3,'Task','1/13/2001','1/15/2001','K3',Null);
		h1 := AddItem('Task 1');
		AddItem('');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/7/2001','1/9/2001','K2',Null);
		AddItem('');
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['<*>',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(1);
	end;
	EndUpdate();
end
1784
What options do I have to show the links between bars (round)

with G2antt1 do
begin
	BeginUpdate();
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 128;
		NonworkingDays := 0;
		LinksWidth := 2;
	end;
	with Items do
	begin
		AddItem('');
		h3 := AddItem('Task 3');
		AddItem('');
		AddBar(h3,'Task','1/13/2001','1/15/2001','K3',Null);
		h1 := AddItem('Task 1');
		AddItem('');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/7/2001','1/9/2001','K2',Null);
		AddItem('');
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['<*>',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(-1);
	end;
	EndUpdate();
end
1783
What options do I have to show the links between bars (rectangular, default)

with G2antt1 do
begin
	BeginUpdate();
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 128;
		NonworkingDays := 0;
		LinksWidth := 2;
	end;
	with Items do
	begin
		AddItem('');
		h3 := AddItem('Task 3');
		AddItem('');
		AddBar(h3,'Task','1/13/2001','1/15/2001','K3',Null);
		h1 := AddItem('Task 1');
		AddItem('');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/7/2001','1/9/2001','K2',Null);
		AddItem('');
		AddLink('L1',h1,'K1',h2,'K2');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['<*>',EXG2ANTTLib_TLB.exLinkShowRound] := OleVariant(0);
	end;
	EndUpdate();
end
1782
I have a question about whether the control has the functionality to add two bars on the same item, as one would correspond to the item bar and another bar their progress, but progress is required to show dividedly at different times outside the activity bar item

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	BackColorLevelHeader := BackColor;
	with Chart do
	begin
		LevelCount := 2;
		FirstVisibleDate := '9/20/2006';
		PaneWidth[False] := 64;
		with Bars.Copy('Progress','TProgressD') do
		begin
			Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
			Shape := EXG2ANTTLib_TLB.exShapeThinDown;
		end;
		with Bars.Copy('Progress','TProgressC') do
		begin
			Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
		end;
		with Bars.Copy('Progress','TProgressU') do
		begin
			Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
			Shape := EXG2ANTTLib_TLB.exShapeThinUp;
		end;
	end;
	with Items do
	begin
		h := AddItem('Task');
		AddBar(h,'Task','9/25/2006','9/30/2006','T1',Null);
		AddBar(h,'TProgressU','9/25/2006','10/4/2006','TP1',Null);
		GroupBars(h,'T1',True,h,'TP1',True,OleVariant(3),Null);
		ItemBar[h,'TP1',EXG2ANTTLib_TLB.exBarCaption] := '<font ;6>progress up';
		h := AddItem('Task');
		AddBar(h,'Task','9/26/2006','10/1/2006','T2',Null);
		AddBar(h,'TProgressC','9/26/2006','10/5/2006','TP2',Null);
		GroupBars(h,'T2',True,h,'TP2',True,OleVariant(3),Null);
		ItemBar[h,'TP2',EXG2ANTTLib_TLB.exBarCaption] := '<font ;6>progress center';
		h := AddItem('Task');
		AddBar(h,'Task','9/25/2006','9/30/2006','T3',Null);
		AddBar(h,'TProgressD','9/25/2006','10/6/2006','TP3',Null);
		GroupBars(h,'T3',True,h,'TP3',True,OleVariant(3),Null);
		ItemBar[h,'TP3',EXG2ANTTLib_TLB.exBarCaption] := '<font ;6>progress down';
	end;
	EndUpdate();
end
1781
I have a column of date-type, the question is how can I move the associated bar, instead of resizing it (summary, inclusive, working)

with G2antt1 do
begin
	BeginUpdate();
	MarkSearchColumn := False;
	Indent := 11;
	HasLines := EXG2ANTTLib_TLB.exSolidLine;
	Items.AllowCellValueToItemBar := True;
	with Columns do
	begin
		Add('Tasks');
		with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(544);
			Editor.EditType := EXG2ANTTLib_TLB.DateType;
			LevelKey := OleVariant(1);
		end;
		with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(546);
			Editor.EditType := EXG2ANTTLib_TLB.DateType;
			LevelKey := OleVariant(1);
		end;
	end;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		AllowLinkBars := False;
		AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
		LevelCount := 2;
		PaneWidth[False] := 224;
		with Bars do
		begin
			with Add('Underline') do
			begin
				Color := $ff0000;
				Shape := EXG2ANTTLib_TLB.exShapeThinDown;
			end;
			with Add('Task:Underline') do
			begin
				Shortcut := 'T';
				Def[EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True);
			end;
		end;
	end;
	with Items do
	begin
		h := AddItem('Project');
		AddBar(h,'Summary','9/21/2006','10/3/2006',Null,Null);
		h1 := InsertItem(h,Null,'Task 1');
		AddBar(h1,'T','9/21/2006','9/24/2006',Null,Null);
		h2 := InsertItem(h,Null,'Task 2');
		AddBar(h2,'T','9/24/2006','9/28/2006',Null,Null);
		h3 := InsertItem(h,Null,'Task 3');
		AddBar(h3,'T','9/28/2006','10/3/2006',Null,Null);
		DefineSummaryBars(h,'',h1,'');
		DefineSummaryBars(h,'',h2,'');
		DefineSummaryBars(h,'',h3,'');
		ExpandItem[h] := True;
		ItemBold[h] := True;
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarMoveStart] := '9/22/2006';
	end;
	EndUpdate();
end
1780
I have a column of date-type, the question is how can I move the associated bar, instead of resizing it (summary)

with G2antt1 do
begin
	BeginUpdate();
	MarkSearchColumn := False;
	Indent := 11;
	HasLines := EXG2ANTTLib_TLB.exSolidLine;
	Items.AllowCellValueToItemBar := True;
	with Columns do
	begin
		Add('Tasks');
		with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(544);
			Editor.EditType := EXG2ANTTLib_TLB.DateType;
			LevelKey := OleVariant(1);
		end;
		with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(545);
			Editor.EditType := EXG2ANTTLib_TLB.DateType;
			LevelKey := OleVariant(1);
		end;
	end;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		AllowLinkBars := False;
		AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
		LevelCount := 2;
		PaneWidth[False] := 224;
	end;
	with Items do
	begin
		h := AddItem('Project');
		AddBar(h,'Summary','9/21/2006','10/3/2006',Null,Null);
		h1 := InsertItem(h,Null,'Task 1');
		AddBar(h1,'Task','9/21/2006','9/24/2006',Null,Null);
		h2 := InsertItem(h,Null,'Task 2');
		AddBar(h2,'Task','9/24/2006','9/28/2006',Null,Null);
		h3 := InsertItem(h,Null,'Task 3');
		AddBar(h3,'Task','9/28/2006','10/3/2006',Null,Null);
		DefineSummaryBars(h,'',h1,'');
		DefineSummaryBars(h,'',h2,'');
		DefineSummaryBars(h,'',h3,'');
		ExpandItem[h] := True;
		ItemBold[h] := True;
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarMoveStart] := '9/22/2006';
	end;
	EndUpdate();
end
1779
Is it possible to programmatically move all bars of specified key to end at specified date (inclusive)

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<A*>',EXG2ANTTLib_TLB.exBarMoveEndInclusive] := '1/2/2001';
	end;
	EndUpdate();
end
1778
Is it possible to programmatically move all bars to end at specified date (inclusive)

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarMoveEndInclusive] := '1/2/2001';
	end;
	EndUpdate();
end
1777
Is it possible to programmatically move all bars of specified key to end at specified date

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<A*>',EXG2ANTTLib_TLB.exBarMoveEnd] := '1/2/2001';
	end;
	EndUpdate();
end
1776
Is it possible to programmatically move all bars to end at specified date

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarMoveEnd] := '1/2/2001';
	end;
	EndUpdate();
end
1775
Is it possible to programmatically move all bars of specified key to start at specified date

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<A*>',EXG2ANTTLib_TLB.exBarMoveStart] := '1/2/2001';
	end;
	EndUpdate();
end
1774
Is it possible to programmatically move all bars to start at specified date

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarMoveStart] := '1/2/2001';
	end;
	EndUpdate();
end
1773
Is it possible to programmatically move all bars of specified key

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<A*>',EXG2ANTTLib_TLB.exBarMove] := OleVariant(2);
	end;
	EndUpdate();
end
1772
Is it possible to programmatically move all bars

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		AddBar(AddItem('Task A.1'),'Task','1/1/2001','1/6/2001','A',Null);
		AddBar(AddItem('Task A.2'),'Task','1/2/2001','1/7/2001','A',Null);
		AddBar(AddItem('Task B.1'),'Task','1/3/2001','1/8/2001','B',Null);
		AddBar(AddItem('Task B.2'),'Task','1/4/2001','1/9/2001','B',Null);
		ItemBar[0,'<*>',EXG2ANTTLib_TLB.exBarMove] := OleVariant(2);
	end;
	EndUpdate();
end
1771
How can I programmatically move a bar, so it ends at specified date (inclusive)
with G2antt1 do
begin
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		h := AddItem('Task 1');
		AddBar(h,'Task','1/1/2001','1/6/2001','A',Null);
		ItemBar[h,'A',EXG2ANTTLib_TLB.exBarMoveEndInclusive] := '1/4/2001';
	end;
end
1770
How can I programmatically move a bar, so it ends at specified date
with G2antt1 do
begin
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		h := AddItem('Task 1');
		AddBar(h,'Task','1/1/2001','1/6/2001','A',Null);
		ItemBar[h,'A',EXG2ANTTLib_TLB.exBarMoveEnd] := '1/4/2001';
	end;
end
1769
How can I programmatically move a bar, so it starts at specified date
with G2antt1 do
begin
	Columns.Add('Tasks');
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
	end;
	with Items do
	begin
		h := AddItem('Task 1');
		AddBar(h,'Task','1/1/2001','1/6/2001','A',Null);
		ItemBar[h,'A',EXG2ANTTLib_TLB.exBarMoveStart] := '1/4/2001';
	end;
end
1768
I can’t figure out how to control the date and time format (in level 0, 1 and 2) when the user click on the OverviewZoom bottom

with G2antt1 do
begin
	BeginUpdate();
	HeaderHeight := 22;
	with Chart do
	begin
		FirstVisibleDate := '1/1/2016';
		PaneWidth[False] := 0;
		LevelCount := 2;
		DrawLevelSeparator := EXG2ANTTLib_TLB.exLevelSolidLine;
		AllowResizeChart := Integer(EXG2ANTTLib_TLB.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartHeader);
		MaxUnitWidth := 196;
		with Level[0] do
		begin
			Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment);
			DrawTickLines := EXG2ANTTLib_TLB.exLevelSolidLine;
		end;
		with Level[1] do
		begin
			DrawTickLines := Integer(EXG2ANTTLib_TLB.exLevelMiddleLine) Or Integer(EXG2ANTTLib_TLB.exLevelDotLine);
			DrawTickLinesFrom(0,EXG2ANTTLib_TLB.exLevelSolidLine);
			BackColor := $f0f0f0;
		end;
		OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
		AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
		UnitWidth := 24;
		Label[EXG2ANTTLib_TLB.exSecond] := '';
		Label[EXG2ANTTLib_TLB.exMinute] := '';
		Label[EXG2ANTTLib_TLB.exHour] := '';
		Label[EXG2ANTTLib_TLB.exWeek] := '';
		Label[EXG2ANTTLib_TLB.exDay] := '<font ;6><%d%><|><%d%><|><%d%> <fgcolor=A0A0A0><off -4><%d1%><|><%d%> <fgcolor=A0A0A0><off -4><%d2%><|><%d%> <fgcolor=A0A0A0><of' + 
	'f -4><%d3%><|><%d%> <fgcolor=A0A0A0><off -4><%dddd%><||><||>4096';
		UnitScale := EXG2ANTTLib_TLB.exDay;
		ScrollTo(FirstVisibleDate,OleVariant(1));
	end;
	Columns.Add('Default');
	EndUpdate();
end
1767
Can I use GroupBars with OverlaidType method

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	Debug := True;
	LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
	ScrollBySingleLine := True;
	BackColorLevelHeader := BackColor;
	with Chart do
	begin
		LevelCount := 2;
		FirstVisibleDate := '9/20/2006';
		PaneWidth[False] := 96;
		Bars.Item['Task'].OverlaidType := EXG2ANTTLib_TLB.exOverlaidBarsStack;
	end;
	with Items do
	begin
		h := AddItem('Project');
		AddBar(h,'Summary','9/21/2006','10/4/2006',Null,Null);
		h1 := InsertItem(h,Null,'Tasks');
		AddBar(h1,'Task','9/21/2006','9/26/2006','h1',Null);
		h2 := h1;
		AddBar(h2,'Task','9/25/2006','9/30/2006','h2',Null);
		AddLink('L1',h1,'h1',h2,'h2');
		h3 := h1;
		AddBar(h3,'Task','9/29/2006','10/4/2006','h3',Null);
		AddLink('L2',h2,'h2',h3,'h3');
		DefineSummaryBars(h,'',h1,'h1');
		DefineSummaryBars(h,'',h2,'h2');
		DefineSummaryBars(h,'',h3,'h3');
		ExpandItem[h] := True;
		ItemBold[h] := True;
		GroupBars(h1,'h1',False,h2,'h2',True,OleVariant(31),'0;5;-1');
		GroupBars(h2,'h2',False,h3,'h3',True,OleVariant(31),'0;5;-1');
	end;
	EndUpdate();
end
1766
How do I change the link's lag so I can schedule bars to start later (with nonworking part)

// BarResizing event - Occurs when a bar is moving or resizing.
procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
	with G2antt1 do
	begin
		Items.SchedulePDM(Item,OleVariant(Key));
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	DefaultItemHeight := 22;
	HeaderHeight := DefaultItemHeight;
	BackColorLevelHeader := BackColor;
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		LinksStyle := EXG2ANTTLib_TLB.exLinkSolid;
		LinksColor := $808080;
		LevelCount := 2;
		FirstVisibleDate := '12/28/2000';
		PaneWidth[False] := 48;
		with Bars.Item['Task'] do
		begin
			Def[EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True);
			Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
			Color := $0;
			StartColor := $bebebe;
			EndColor := StartColor;
			Pattern := EXG2ANTTLib_TLB.exPatternBox;
		end;
	end;
	with Items do
	begin
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/5/2001','K1','FS lag=0 (default)');
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/2/2001','1/5/2001','K2','FS lag=4');
		AddLink('L1',h1,'K1',h2,'K2');
		h3 := AddItem('Task 3');
		AddBar(h3,'Task','1/2/2001','1/5/2001','K3','FS lag=-1');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['L2',EXG2ANTTLib_TLB.exLinkPDMWorkingDelay] := OleVariant(4);
		h4 := AddItem('Task 4');
		AddBar(h4,'Task','1/2/2001','1/5/2001','K4',Null);
		AddLink('L3',h3,'K3',h4,'K4');
		Link['L3',EXG2ANTTLib_TLB.exLinkPDMWorkingDelay] := OleVariant(-1);
		SchedulePDM(0,'K1');
	end;
	EndUpdate();
end
1765
How do I change the link's lag so I can schedule bars to start later (without nonworking part)

// BarResizing event - Occurs when a bar is moving or resizing.
procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
	with G2antt1 do
	begin
		Items.SchedulePDM(Item,OleVariant(Key));
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	DefaultItemHeight := 22;
	HeaderHeight := DefaultItemHeight;
	BackColorLevelHeader := BackColor;
	AntiAliasing := True;
	Columns.Add('Task');
	with Chart do
	begin
		LinksStyle := EXG2ANTTLib_TLB.exLinkSolid;
		LinksColor := $808080;
		LevelCount := 2;
		NonworkingDays := 0;
		FirstVisibleDate := '12/28/2000';
		PaneWidth[False] := 48;
		with Bars.Item['Task'] do
		begin
			Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
			Color := $0;
			StartColor := $bebebe;
			EndColor := StartColor;
			Pattern := EXG2ANTTLib_TLB.exPatternBox;
		end;
	end;
	with Items do
	begin
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/5/2001','K1','FS lag=0 (default)');
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/2/2001','1/5/2001','K2','FS lag=4');
		AddLink('L1',h1,'K1',h2,'K2');
		h3 := AddItem('Task 3');
		AddBar(h3,'Task','1/2/2001','1/5/2001','K3','FS lag=-1');
		AddLink('L2',h2,'K2',h3,'K3');
		Link['L2',EXG2ANTTLib_TLB.exLinkPDMDelay] := OleVariant(4);
		h4 := AddItem('Task 4');
		AddBar(h4,'Task','1/2/2001','1/5/2001','K4',Null);
		AddLink('L3',h3,'K3',h4,'K4');
		Link['L3',EXG2ANTTLib_TLB.exLinkPDMDelay] := OleVariant(-1);
		SchedulePDM(0,'K1');
	end;
	EndUpdate();
end
1764
Is it possible to select the entire row/line, when user clicks the first column, and select individually the rest of cells, while user clicks any other column

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// MouseDown event - Occurs when the user presses a mouse button.
procedure TForm1.G2antt1MouseDown(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
	with G2antt1 do
	begin
		i := ItemFromPoint[-1,-1,c,hit];
		FullRowSelect := Columns.Item[OleVariant(c)].Data;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	HeaderHeight := 22;
	HeaderAppearance := EXG2ANTTLib_TLB.Flat;
	BackColorLock := RGB(240,240,240);
	BackColorHeader := BackColorLock;
	HasLines := EXG2ANTTLib_TLB.exNoLine;
	ColumnAutoResize := False;
	SortBarVisible := False;
	AllowGroupBy := True;
	ReadOnly := EXG2ANTTLib_TLB.exReadOnly;
	ShowFocusRect := False;
	CountLockedColumns := 1;
	AutoDrag := EXG2ANTTLib_TLB.exAutoDragScroll;
	SingleSort := False;
	ColumnsAllowSizing := True;
	DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
	GridLineStyle := EXG2ANTTLib_TLB.exGridLinesSolid;
	GridLineColor := RGB(220,220,220);
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.LevelCount := 2;
	Chart.PaneWidth[False] := 256;
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Columns.Item[OleVariant(0)].Data := OleVariant(-1);
	Layout := 'singlesort="C5:1";multiplesort=" C1:2"';
	EndUpdate();
end
1763
I've also hit a strange problem with the BeforeExpandItem event - the Cancel parameter is declared as const in Delphi when I believe it should be declared as var or out so I can use it to return OleVariant(True) to cancel the operation, or am I missing something, or how can I disable expanding / collapsing the items
// BeforeExpandItem event - Fired before an item is about to be expanded (collapsed).
procedure TForm1.G2antt1BeforeExpandItem(ASender: TObject; Item : HITEM;var Cancel : OleVariant);
begin
	with G2antt1 do
	begin
		EventParam[1] := OleVariant(True);
	end
end;

// Event event - Notifies the application once the control fires an event.
procedure TForm1.G2antt1Event(ASender: TObject; EventID : Integer);
begin
	with G2antt1 do
	begin
		OutputDebugString( EventParam[-2] );
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
	Columns.Add('Default');
	with Items do
	begin
		h := AddItem('Root A');
		InsertItem(h,Null,'Child 1');
		InsertItem(h,Null,'Child 2');
		ExpandItem[h] := True;
		h := AddItem('Root B');
		InsertItem(h,Null,'Child 1');
		InsertItem(h,Null,'Child 2');
		ExpandItem[h] := True;
	end;
	EndUpdate();
end
1762
Is there any way I can get rid / hide of the vertical blue lines ( today, selected date )
with G2antt1 do
begin
	BeginUpdate();
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		MarkSelectDateColor := BackColor;
		MarkTodayColor := BackColor;
	end;
	EndUpdate();
end
1761
Is it possible to search for a bar through items only ( not including the locked items )

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		FirstVisibleDate := '12/31/2015';
	end;
	BackColorAlternate := RGB(250,250,250);
	ShowLockedItems := True;
	Columns.Add('Column');
	with (IUnknown(Columns.Add('Find')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1);
		Visible := False;
		FormatColumn := 'int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` ';
	end;
	Chart.ColumnsFormatLevel := '1';
	with Items do
	begin
		LockedItemCount[EXG2ANTTLib_TLB.exTop] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exTop,0];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T1',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T2',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,2];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		AddBar(AddItem('un-locked item 1'),'Task','1/4/2016','1/8/2016','T3',Null);
		AddBar(AddItem('un-locked item 2'),'Task','1/5/2016','1/9/2016','T4',Null);
		LockedItemCount[EXG2ANTTLib_TLB.exMiddle] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,0];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T5',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,2];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T6',Null);
	end;
	with Items do
	begin
		h := FindBar['T4',OleVariant(0)];
		ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarColor] := OleVariant(255);
		CellValue[OleVariant(h),OleVariant(1)] := OleVariant(h);
	end;
	EndUpdate();
end
1760
Is it possible to search for a bar through bottom-locked-items only

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		FirstVisibleDate := '12/31/2015';
	end;
	BackColorAlternate := RGB(250,250,250);
	ShowLockedItems := True;
	Columns.Add('Column');
	with (IUnknown(Columns.Add('Find')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1);
		Visible := False;
		FormatColumn := 'int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` ';
	end;
	Chart.ColumnsFormatLevel := '1';
	with Items do
	begin
		LockedItemCount[EXG2ANTTLib_TLB.exTop] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exTop,0];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T1',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T2',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,2];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		AddBar(AddItem('un-locked item 1'),'Task','1/4/2016','1/8/2016','T3',Null);
		AddBar(AddItem('un-locked item 2'),'Task','1/5/2016','1/9/2016','T4',Null);
		LockedItemCount[EXG2ANTTLib_TLB.exMiddle] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,0];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T5',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,2];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T6',Null);
	end;
	with Items do
	begin
		h := FindBar['T6',OleVariant(-4)];
		ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarColor] := OleVariant(255);
		CellValue[OleVariant(h),OleVariant(1)] := OleVariant(h);
	end;
	EndUpdate();
end
1759
Is it possible to search for a bar through top-locked-items only

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		FirstVisibleDate := '12/31/2015';
	end;
	BackColorAlternate := RGB(250,250,250);
	ShowLockedItems := True;
	Columns.Add('Column');
	with (IUnknown(Columns.Add('Find')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1);
		Visible := False;
		FormatColumn := 'int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` ';
	end;
	Chart.ColumnsFormatLevel := '1';
	with Items do
	begin
		LockedItemCount[EXG2ANTTLib_TLB.exTop] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exTop,0];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T1',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T2',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,2];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		AddBar(AddItem('un-locked item 1'),'Task','1/4/2016','1/8/2016','T3',Null);
		AddBar(AddItem('un-locked item 2'),'Task','1/5/2016','1/9/2016','T4',Null);
		LockedItemCount[EXG2ANTTLib_TLB.exMiddle] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,0];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T5',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,2];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T6',Null);
	end;
	with Items do
	begin
		h := FindBar['T1',OleVariant(-3)];
		ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarColor] := OleVariant(255);
		CellValue[OleVariant(h),OleVariant(1)] := OleVariant(h);
	end;
	EndUpdate();
end
1758
Is it possible to search for a bar through all locked-items only

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		FirstVisibleDate := '12/31/2015';
	end;
	BackColorAlternate := RGB(250,250,250);
	ShowLockedItems := True;
	Columns.Add('Column');
	with (IUnknown(Columns.Add('Find')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1);
		Visible := False;
		FormatColumn := 'int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` ';
	end;
	Chart.ColumnsFormatLevel := '1';
	with Items do
	begin
		LockedItemCount[EXG2ANTTLib_TLB.exTop] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exTop,0];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T1',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T2',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,2];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		AddBar(AddItem('un-locked item 1'),'Task','1/4/2016','1/8/2016','T3',Null);
		AddBar(AddItem('un-locked item 2'),'Task','1/5/2016','1/9/2016','T4',Null);
		LockedItemCount[EXG2ANTTLib_TLB.exMiddle] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,0];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T5',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,2];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T6',Null);
	end;
	with Items do
	begin
		h := FindBar['T2',OleVariant(-2)];
		ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarColor] := OleVariant(255);
		CellValue[OleVariant(h),OleVariant(1)] := OleVariant(h);
	end;
	EndUpdate();
end
1757
Is it possible to search for a bar through all items ( including locked items )

with G2antt1 do
begin
	BeginUpdate();
	Debug := True;
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		FirstVisibleDate := '12/31/2015';
	end;
	BackColorAlternate := RGB(250,250,250);
	ShowLockedItems := True;
	Columns.Add('Column');
	with (IUnknown(Columns.Add('Find')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1);
		Visible := False;
		FormatColumn := 'int(value) = 0 ? `` : ` <fgcolor=FF0000><b>found here ` ';
	end;
	Chart.ColumnsFormatLevel := '1';
	with Items do
	begin
		LockedItemCount[EXG2ANTTLib_TLB.exTop] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exTop,0];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T1',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-top 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T2',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exTop,2];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		AddBar(AddItem('un-locked item 1'),'Task','1/4/2016','1/8/2016','T3',Null);
		AddBar(AddItem('un-locked item 2'),'Task','1/5/2016','1/9/2016','T4',Null);
		LockedItemCount[EXG2ANTTLib_TLB.exMiddle] := 3;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,0];
		SelectItem[h] := False;
		ItemDivider[h] := 0;
		ItemHeight[h] := 2;
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,1];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 1';
		AddBar(h,'Task','1/4/2016','1/8/2016','T5',Null);
		h := LockedItem[EXG2ANTTLib_TLB.exMiddle,2];
		CellValue[OleVariant(h),OleVariant(0)] := 'locked-bottom 2';
		AddBar(h,'Task','1/5/2016','1/9/2016','T6',Null);
	end;
	with Items do
	begin
		h := FindBar['T5',OleVariant(-1)];
		ItemBar[h,FirstItemBar[h],EXG2ANTTLib_TLB.exBarColor] := OleVariant(255);
		CellValue[OleVariant(h),OleVariant(1)] := OleVariant(h);
	end;
	EndUpdate();
end
1756
How do I clip/hide/align the bar's caption/text based on the bar's size/width/length

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Clip');
	ScrollBySingleLine := True;
	DrawGridLines := EXG2ANTTLib_TLB.exRowLines;
	with Chart do
	begin
		AllowResizeChart := Integer(EXG2ANTTLib_TLB.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartHeader);
		DrawGridLines := EXG2ANTTLib_TLB.exRowLines;
		FirstVisibleDate := '12/23/2000';
		LevelCount := 2;
		PaneWidth[False] := 216;
		with Bars.Item['Task'] do
		begin
			Pattern := EXG2ANTTLib_TLB.exPatternBox;
			Color := $a4a4a4;
			StartColor := $f0f0f0;
			EndColor := StartColor;
			OverlaidType := Integer(EXG2ANTTLib_TLB.exOverlaidBarsIncludeCaption) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStackAutoArrange) Or Integer(EXG2ANTTLib_TLB.exOverlaidBarsStack);
			Height := 15;
		end;
		MinUnitWidth := UnitWidth;
	end;
	with Items do
	begin
		h := AddItem('no clip, (0-2)');
		AddBar(h,'Task','1/2/2001','1/4/2001','K1','no clip, right(<b>2</b>)');
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(2);
		AddBar(h,'Task','1/2/2001','1/4/2001','K2','no clip, center(<b>1</b>)');
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(1);
		AddBar(h,'Task','1/2/2001','1/4/2001','K3','no clip, left(<b>0</b>)');
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(0);
		h := AddItem('clip, inside (3-5)');
		AddBar(h,'Task','12/28/2000','1/8/2001','K1','clip, inside, right(<b>5</b>)');
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(5);
		AddBar(h,'Task','12/28/2000','1/8/2001','K2','clip, inside, center(<b>4</b>)');
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(4);
		AddBar(h,'Task','12/28/2000','1/8/2001','K3','clip, inside, left(<b>3</b>)');
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(3);
		h := AddItem('hide on min width, clip if not fit, inside (6-8)');
		AddBar(h,'Task','12/26/2000','1/10/2001','K1','hide on min width, clip if not fit, inside, right(<b>8</b>)');
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(8);
		AddBar(h,'Task','12/26/2000','1/10/2001','K2','hide on min width, clip if not fit, inside, center(<b>7</b>)');
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(7);
		AddBar(h,'Task','12/26/2000','1/10/2001','K3','hide on min width, clip if not fit, inside, left(<b>6</b>)');
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(6);
		h := AddItem('hide if not fit, no clip, inside (9-11)');
		AddBar(h,'Task','12/28/2000','1/8/2001','K1','hide if not fit, no clip, inside, right(<b>11</b>)');
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(11);
		AddBar(h,'Task','12/28/2000','1/8/2001','K2','hide if not fit, no clip, center(<b>10</b>)');
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(10);
		AddBar(h,'Task','12/28/2000','1/8/2001','K3','hide if not fit, no clip, inside, left(<b>9</b>)');
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(9);
		h := AddItem('no clip, inside, outside (12-14)');
		AddBar(h,'Task','12/28/2000','1/8/2001','K1','no clip, inside, outside, right(<b>14</b>)');
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(14);
		AddBar(h,'Task','12/28/2000','1/8/2001','K2','no clip, inside, outside, center(<b>13</b>)');
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(13);
		AddBar(h,'Task','12/28/2000','1/8/2001','K3','no clip, inside, outside, left(<b>12</b>)');
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(12);
		h := AddItem('no clip, outside (16-18)');
		AddBar(h,'Task','12/30/2000','1/6/2001','K1','no clip, outside, right(<b>18</b>)');
		ItemBar[h,'K1',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
		AddBar(h,'Task','12/30/2000','1/6/2001','K2','no clip, outside, center(<b>17</b>)');
		ItemBar[h,'K2',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(17);
		AddBar(h,'Task','12/30/2000','1/6/2001','K3','no clip, outside, left(<b>16</b>)');
		ItemBar[h,'K3',EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(16);
	end;
	EndUpdate();
end
1755
Is there a way to prevent the automatic horizontal scrolling of the chart when moving or resizing a bar (method 2)
// DateChange event - Occurs when the first visible date is changed.
procedure TForm1.G2antt1DateChange(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Chart.FirstVisibleDate := '1/2/2001';
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with (IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.LeftAlignment;
	end;
	with (IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.RightAlignment;
	end;
	with Chart do
	begin
		FirstVisibleDate := '1/2/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
		ColumnsFormatLevel := '1[bg=12500670]:52,|,2[bg=12500670]:52';
		ColumnsTransparent := 50;
		ScrollBar := False;
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null);
		AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null);
	end;
	EndUpdate();
end
1754
Is there a way to prevent the automatic horizontal scrolling of the chart when moving or resizing a bar, including limiting the bars
// BarResizing event - Occurs when a bar is moving or resizing.
procedure TForm1.G2antt1BarResizing(ASender: TObject; Item : HITEM;Key : OleVariant);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarMinStart] := '1/1/2001';
			ItemBar[Item,OleVariant(Key),EXG2ANTTLib_TLB.exBarMaxEnd] := '2/1/2001';
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with (IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.LeftAlignment;
	end;
	with (IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.RightAlignment;
	end;
	with Chart do
	begin
		FirstVisibleDate := '1/2/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
		ColumnsFormatLevel := '1[bg=12500670]:52,|,2[bg=12500670]:52';
		ColumnsTransparent := 50;
		ScrollRange[EXG2ANTTLib_TLB.exStartDate] := '1/1/2001';
		ScrollRange[EXG2ANTTLib_TLB.exEndDate] := '1/31/2001';
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null);
		AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null);
	end;
	EndUpdate();
end
1753
Is there a way to prevent the automatic horizontal scrolling of the chart when moving or resizing a bar (method 1)
with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with (IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.LeftAlignment;
	end;
	with (IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.RightAlignment;
	end;
	with Chart do
	begin
		FirstVisibleDate := '1/2/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
		ColumnsFormatLevel := '1[bg=12500670]:52,|,2[bg=12500670]:52';
		ColumnsTransparent := 50;
		ScrollRange[EXG2ANTTLib_TLB.exStartDate] := '1/1/2001';
		ScrollRange[EXG2ANTTLib_TLB.exEndDate] := '1/31/2001';
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null);
		AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null);
	end;
	EndUpdate();
end
1752
Is it possible to have "Preview Window" as a "Modal Window or 'always-on-top window'"
with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	Chart.FirstVisibleDate := '1/1/2001';
	with Items do
	begin
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := AddItem('Task 2');
		AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
		AddLink('L1',h1,'K1',h2,'K2');
		Link['L1',EXG2ANTTLib_TLB.exLinkStartPos] := OleVariant(0);
	end;
	EndUpdate();
	with (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('Exontrol.Print'))) as EXPRINTLib_TLB.Print) do
	begin
		OutputDebugString( Version );
		Foreground := -1;
		PrintExt := (IUnknown(G2antt1.DefaultInterface) as EXG2ANTTLib_TLB.G2antt);
		Preview();
	end;
end
1751
The week number is not correct (wrong). What can I do

with G2antt1 do
begin
	with Chart do
	begin
		FirstWeekDay := LocFirstWeekDay;
		MonthNames := LocMonthNames;
		WeekDays := LocWeekDays;
		AMPM := LocAMPM;
		LevelCount := 2;
		PaneWidth[False] := 0;
		UnitScale := EXG2ANTTLib_TLB.exWeek;
		UnitWidth := 32;
		FirstVisibleDate := '1/1/2016';
		AdjustLevelsToBase := True;
		WeekNumberAs := EXG2ANTTLib_TLB.exISO8601WeekNumber;
		ShowNonworkingDates := False;
		ScrollTo(FirstVisibleDate,OleVariant(1));
	end;
end
1750
When the user zooms with the mouse, the chart automatically switches the unit scale - ideally I'd like to replicate this so I can switch the unitscale at the same "zoom levels" that the mouse zooming does - is this possible
// ChartEndChanging event - Occurs after the chart has been changed.
procedure TForm1.G2antt1ChartEndChanging(ASender: TObject; Operation : BarOperationEnum);
begin
	with G2antt1 do
	begin
		with Chart do
		begin
			OutputDebugString( 'FirstVisibleDate' );
			OutputDebugString( FirstVisibleDate );
			OutputDebugString( 'UnitScale' );
			OutputDebugString( UnitScale );
			OutputDebugString( 'UnitWidth' );
			OutputDebugString( UnitWidth );
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	with Chart do
	begin
		LevelCount := 3;
		AllowResizeChart := Integer(EXG2ANTTLib_TLB.exAllowChangeUnitScale) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartMiddle) Or Integer(EXG2ANTTLib_TLB.exAllowResizeChartHeader);
		PaneWidth[False] := 0;
		MarkTodayColor := BackColor;
	end;
	EndUpdate();
end
1749
The first week number is not correctly assigned. What can I do

with G2antt1 do
begin
	with Chart do
	begin
		PaneWidth[False] := 0;
		FirstVisibleDate := '1/1/2016';
		LevelCount := 2;
		FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
		UnitScale := EXG2ANTTLib_TLB.exWeek;
		ScrollTo(FirstVisibleDate,OleVariant(1));
		DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
		AdjustLevelsToBase := True;
		Level[0].Label := '<c><%mmmm%>';
	end;
end
1748
How can I display the +/- expand - collapse buttons, a bit larger

with G2antt1 do
begin
	BeginUpdate();
	with VisualAppearance do
	begin
		Add(3,'c:\exontrol\images\normal.ebn');
		Add(4,'c:\exontrol\images\pushed.ebn');
		Add(1,'CP:3 -4 -4 4 4');
		Add(2,'CP:4 -4 -4 4 4');
	end;
	LinesAtRoot := EXG2ANTTLib_TLB.exGroupLinesAtRoot;
	HasButtons := EXG2ANTTLib_TLB.exCustom;
	HasButtonsCustom[False] := 16777216;
	HasButtonsCustom[True] := 33554432;
	Columns.Add('Column');
	with Items do
	begin
		h := AddItem('Root 1');
		InsertItem(h,Null,'Child 1');
		InsertItem(h,Null,'Child 2');
		ExpandItem[h] := True;
		h := AddItem('Root 2');
		InsertItem(h,Null,'Child');
	end;
	EndUpdate();
end
1747
Is there any option to control where I can drop the items when using the AutoDrag property
// AllowAutoDrag event - Occurs when the user drags the item between InsertA and InsertB as child of NewParent.
procedure TForm1.G2antt1AllowAutoDrag(ASender: TObject; Item : HITEM;NewParent : HITEM;InsertA : HITEM;InsertB : HITEM;var Cancel : WordBool);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			OutputDebugString( 'NewParent' );
			OutputDebugString( CellCaption[OleVariant(NewParent),OleVariant(0)] );
			OutputDebugString( 'After' );
			OutputDebugString( CellCaption[OleVariant(InsertA),OleVariant(0)] );
			OutputDebugString( 'Before' );
			OutputDebugString( CellCaption[OleVariant(InsertB),OleVariant(0)] );
		end;
		Cancel := True;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	AutoDrag := EXG2ANTTLib_TLB.exAutoDragPositionAny;
	LinesAtRoot := EXG2ANTTLib_TLB.exNoLinesAtRoot;
	HasLines := EXG2ANTTLib_TLB.exThinLine;
	ShowFocusRect := False;
	Columns.Add('Task');
	with Chart do
	begin
		ShowNonworkingDates := False;
		FirstVisibleDate := '12/29/2000';
		PaneWidth[False] := 96;
		LevelCount := 2;
	end;
	with Items do
	begin
		h := AddItem('Group 1');
		ItemDivider[h] := 0;
		ItemBold[h] := True;
		h1 := InsertItem(h,Null,'Task 1');
		AddBar(h1,'Task','1/2/2001','1/4/2001','K1',Null);
		h2 := InsertItem(h,Null,'Task 2');
		AddBar(h2,'Task','1/5/2001','1/7/2001','K2',Null);
		AddLink('L1',h1,'K1',h2,'K2');
		Link['L1',EXG2ANTTLib_TLB.exLinkText] := 'L1';
		h3 := InsertItem(h,Null,'Task 3');
		AddBar(h3,'Task','1/8/2001','1/10/2001','K3',Null);
		AddLink('L2',h2,'K2',h3,'K3');
		Link['L2',EXG2ANTTLib_TLB.exLinkText] := 'L2';
		ExpandItem[h] := True;
		h := AddItem('Group 2');
		ItemBold[h] := True;
		ItemDivider[h] := 0;
	end;
	EndUpdate();
end
1746
The column (chart section ) overlaps the bars, when using the ColumnsFormatLevel property. How can I prevent that

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with (IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.LeftAlignment;
	end;
	with (IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.RightAlignment;
	end;
	with Chart do
	begin
		FirstVisibleDate := '1/2/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
		ColumnsFormatLevel := '1[bg=12500670]:52,|,2[bg=12500670]:52';
		ColumnsTransparent := 50;
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null);
		AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null);
	end;
	EndUpdate();
end
1745
How do I show the column ( chart section ) with a different background color, when using the ColumnsFormatLevel property (method 2)

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with (IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.LeftAlignment;
	end;
	with (IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.RightAlignment;
	end;
	with Chart do
	begin
		FirstVisibleDate := '1/2/2001';
		LevelCount := 2;
		PaneWidth[False] := 48;
		ColumnsFormatLevel := '1[bg=12500670]:52,|,2[bg=12500670]:52';
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null);
		AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null);
	end;
	EndUpdate();
end
1744
How do I show the column ( chart section ) with a different background color, when using the ColumnsFormatLevel property (method 1)

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with (IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.LeftAlignment;
		Def[EXG2ANTTLib_TLB.exCellBackColor] := OleVariant(12500670);
	end;
	with (IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
		Visible := False;
		Alignment := EXG2ANTTLib_TLB.RightAlignment;
		Def[EXG2ANTTLib_TLB.exCellBackColor] := OleVariant(12500670);
	end;
	with Chart do
	begin
		FirstVisibleDate := '12/31/2000';
		LevelCount := 2;
		PaneWidth[False] := 48;
		ColumnsFormatLevel := '1:52,|,2:52';
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','1/3/2001','1/7/2001',Null,Null);
		AddBar(AddItem('Task 2'),'Task','1/4/2001','1/8/2001',Null,Null);
	end;
	EndUpdate();
end
1743
How can I display the control's content on an single A3 paper size, when using PDF format

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	AntiAliasing := True;
	with Chart do
	begin
		FirstVisibleDate := '12/24/2000';
		PaneWidth[False] := 96;
		LevelCount := 2;
		UnitScale := EXG2ANTTLib_TLB.exDay;
		with Bars.Item['Task'] do
		begin
			Pattern := EXG2ANTTLib_TLB.exPatternSolid;
			Color := $0;
			Height := 16;
		end;
	end;
	with Items do
	begin
		h := AddItem('Task 1');
		AddBar(h,'Task','12/25/2000','1/5/2001','1','<fgcolor=FFFFFF>Center');
		ItemBar[h,'1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'left';
		ItemBar[h,'1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(16);
		h := AddItem('Task 2');
		AddBar(h,'Task','1/5/2001','1/16/2001','1','<fgcolor=FFFFFF>Center');
		h := AddItem('Task 3');
		AddBar(h,'Task','1/16/2001','1/26/2001','2','Center');
		ItemBar[h,'2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'right';
		ItemBar[h,'2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(18);
	end;
	with Chart.Notes do
	begin
		with Add('1S',OleVariant(G2antt1.Items.ItemByIndex[1]),'1','<%m3%>-<%d%>') do
		begin
			PartShadow[EXG2ANTTLib_TLB.exNoteEnd] := False;
			PartHOffset[EXG2ANTTLib_TLB.exNoteEnd] := -16;
			PartVOffset[EXG2ANTTLib_TLB.exNoteEnd] := 4;
		end;
		with Add('1F',OleVariant(G2antt1.Items.ItemByIndex[1]),'1','<%m3%>-<%d%>') do
		begin
			RelativePosition := OleVariant(1);
			PartShadow[EXG2ANTTLib_TLB.exNoteEnd] := False;
			PartHOffset[EXG2ANTTLib_TLB.exNoteEnd] := 16;
			PartVOffset[EXG2ANTTLib_TLB.exNoteEnd] := -4;
		end;
	end;
	var_CopyTo := CopyTo['C:\Temp\Preview.pdf|11.69 in x 16.53 in||single'];
	OutputDebugString( 'Look for C:\Temp\Preview.pd file.' );
	EndUpdate();
end
1742
How can I display the control's content on an A3 paper size, when using PDF format

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Task');
	AntiAliasing := True;
	with Chart do
	begin
		FirstVisibleDate := '12/24/2000';
		PaneWidth[False] := 96;
		LevelCount := 2;
		UnitScale := EXG2ANTTLib_TLB.exDay;
		with Bars.Item['Task'] do
		begin
			Pattern := EXG2ANTTLib_TLB.exPatternSolid;
			Color := $0;
			Height := 16;
		end;
	end;
	with Items do
	begin
		h := AddItem('Task 1');
		AddBar(h,'Task','12/25/2000','1/5/2001','1','<fgcolor=FFFFFF>Center');
		ItemBar[h,'1',EXG2ANTTLib_TLB.exBarExtraCaption] := 'left';
		ItemBar[h,'1',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(16);
		h := AddItem('Task 2');
		AddBar(h,'Task','1/5/2001','1/16/2001','1','<fgcolor=FFFFFF>Center');
		h := AddItem('Task 3');
		AddBar(h,'Task','1/16/2001','1/26/2001','2','Center');
		ItemBar[h,'2',EXG2ANTTLib_TLB.exBarExtraCaption] := 'right';
		ItemBar[h,'2',EXG2ANTTLib_TLB.exBarExtraCaptionHAlign] := OleVariant(18);
	end;
	with Chart.Notes do
	begin
		with Add('1S',OleVariant(G2antt1.Items.ItemByIndex[1]),'1','<%m3%>-<%d%>') do
		begin
			PartShadow[EXG2ANTTLib_TLB.exNoteEnd] := False;
			PartHOffset[EXG2ANTTLib_TLB.exNoteEnd] := -16;
			PartVOffset[EXG2ANTTLib_TLB.exNoteEnd] := 4;
		end;
		with Add('1F',OleVariant(G2antt1.Items.ItemByIndex[1]),'1','<%m3%>-<%d%>') do
		begin
			RelativePosition := OleVariant(1);
			PartShadow[EXG2ANTTLib_TLB.exNoteEnd] := False;
			PartHOffset[EXG2ANTTLib_TLB.exNoteEnd] := 16;
			PartVOffset[EXG2ANTTLib_TLB.exNoteEnd] := -4;
		end;
	end;
	var_CopyTo := CopyTo['C:\Temp\Preview.pdf|11.69 in x 16.53 in'];
	OutputDebugString( 'Look for C:\Temp\Preview.pd file.' );
	EndUpdate();
end
1741
How can I specify the grouping strategy, ie numbers from 1 to 5 are given the value (1-5) and grouping is done on this new value

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			ItemBold[Item] := True;
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(1)],CellValue[OleVariant(Item),OleVariant(2)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	AllowGroupBy := True;
	SortBarVisible := True;
	MarkSearchColumn := False;
	with Columns do
	begin
		Add('Tasks');
		with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
			AllowGroupBy := False;
		end;
		with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
			AllowGroupBy := False;
		end;
	end;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		LevelCount := 2;
		PaneWidth[False] := 256;
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('1'),'Task','9/21/2006','9/27/2006',Null,Null);
		AddBar(AddItem('1'),'Task','9/22/2006','9/28/2006',Null,Null);
		AddBar(AddItem('2'),'Task','9/22/2006','9/28/2006',Null,Null);
		AddBar(AddItem('2'),'Task','9/23/2006','9/29/2006',Null,Null);
		AddBar(AddItem('3'),'Task','9/25/2006','9/29/2006',Null,Null);
		AddBar(AddItem('3'),'Task','9/26/2006','9/30/2006',Null,Null);
	end;
	with (IUnknown(Columns.Add('Tasks - Group')) as EXG2ANTTLib_TLB.Column) do
	begin
		Visible := False;
		FormatColumn := '%0 in (1,2) ? `1 - 2` : `3 -`';
		SortOrder := EXG2ANTTLib_TLB.SortAscending;
	end;
	EndUpdate();
end
1740
How can I filter the chart and its content, not the items section

// RClick event - Fired when right mouse button is clicked
procedure TForm1.G2antt1RClick(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Columns.Item['Start'].ShowFilter('-1,-1,128,128');
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	SortBarVisible := True;
	MarkSearchColumn := False;
	with Columns do
	begin
		Add('Tasks');
		with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
			DisplayFilterDate := True;
			DisplayFilterPattern := False;
			FilterList := Integer(EXG2ANTTLib_TLB.exShowExclude) Or Integer(EXG2ANTTLib_TLB.exShowCheckBox);
			Visible := False;
		end;
		with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
			DisplayFilterDate := True;
			DisplayFilterPattern := False;
			Visible := False;
			FilterList := Integer(EXG2ANTTLib_TLB.exShowExclude) Or Integer(EXG2ANTTLib_TLB.exShowCheckBox);
			Visible := False;
		end;
	end;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		LevelCount := 2;
		PaneWidth[False] := 128;
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','9/21/2006','9/27/2006',Null,Null);
		AddBar(AddItem('Task 2'),'Task','9/22/2006','9/28/2006',Null,Null);
		AddBar(AddItem('Task 3'),'Task','9/22/2006','9/28/2006',Null,Null);
		AddBar(AddItem('Task 4'),'Task','9/23/2006','9/29/2006',Null,Null);
		AddBar(AddItem('Task 5'),'Task','9/25/2006','9/29/2006',Null,Null);
		AddBar(AddItem('Task 6'),'Task','9/26/2006','9/30/2006',Null,Null);
	end;
	EndUpdate();
end
1739
How do I enable the Group-By feature

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			ItemBackColor[Item] := $f0f0f0;
			G2antt1.Chart.ItemBackColor[Item] := $f0f0f0;
			ItemDividerLine[Item] := EXG2ANTTLib_TLB.EmptyLine;
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(1)],CellValue[OleVariant(Item),OleVariant(2)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	AllowGroupBy := True;
	SortBarVisible := True;
	MarkSearchColumn := False;
	with Columns do
	begin
		Add('Tasks');
		with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
			AllowGroupBy := False;
		end;
		with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
			AllowGroupBy := False;
		end;
	end;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		LevelCount := 2;
		PaneWidth[False] := 256;
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','9/21/2006','9/27/2006',Null,Null);
		AddBar(AddItem('Task 1'),'Task','9/22/2006','9/28/2006',Null,Null);
		AddBar(AddItem('Task 2'),'Task','9/22/2006','9/28/2006',Null,Null);
		AddBar(AddItem('Task 2'),'Task','9/23/2006','9/29/2006',Null,Null);
		AddBar(AddItem('Task 3'),'Task','9/25/2006','9/29/2006',Null,Null);
		AddBar(AddItem('Task 3'),'Task','9/26/2006','9/30/2006',Null,Null);
	end;
	Columns.Item[OleVariant(0)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
end
1738
Is there any method to know number/length/count/duration of working days in a bar ( excluding non-working days)

// SelectionChanged event - Fired after a new item has been selected.
procedure TForm1.G2antt1SelectionChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		with Items do
		begin
			OutputDebugString( CellCaption[OleVariant(FocusItem),OleVariant(0)] );
			OutputDebugString( ItemBar[FocusItem,'',EXG2ANTTLib_TLB.exBarWorkingCount] );
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	SelBackColor := RGB(142,190,255);
	SelForeColor := RGB(0,0,0);
	with Chart do
	begin
		PaneWidth[False] := 96;
		FirstVisibleDate := '1/1/2002';
		with Bars.Add('Task:Split') do
		begin
			Shortcut := 'Task';
			Def[EXG2ANTTLib_TLB.exBarCaption] := '<%=%258%><font ;6><off 3>w/units';
			Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
		end;
		SelBackColor := G2antt1.SelBackColor;
	end;
	Columns.Add('Task');
	with Items do
	begin
		h := AddItem('Task A');
		AddBar(h,'Task','1/2/2002','1/9/2002',Null,Null);
		h := AddItem('Task B');
		AddBar(h,'Task','1/3/2002','1/8/2002',Null,Null);
		SelectItem[h] := True;
		h := AddItem('Task C');
		AddBar(h,'Task','1/4/2002','1/5/2002',Null,Null);
	end;
	EndUpdate();
end
1737
How do i verify weather specified unit is Nonworking Working Unit

// MouseMove event - Occurs when the user moves the mouse.
procedure TForm1.G2antt1MouseMove(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
	with G2antt1 do
	begin
		h := ItemFromPoint[-1,-1,c,hit];
		d := Chart.DateFromPoint[-1,-1];
		OutputDebugString( d );
		OutputDebugString( Chart.IsNonworkingDate[OleVariant(d),OleVariant(h)] );
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('NonWorking');
	with Chart do
	begin
		FirstWeekDay := EXG2ANTTLib_TLB.exMonday;
		FirstVisibleDate := '1/24/2008';
		PaneWidth[False] := 64;
		LevelCount := 2;
	end;
	with Items do
	begin
		h := AddItem('Default');
		h := AddItem('January');
		ItemNonworkingUnits[h,OleVariant(False)] := 'month(value) = 1';
		h := AddItem('February, Saturday, Sunday');
		ItemNonworkingUnits[h,OleVariant(False)] := 'month(value) = 2 or (weekday(value) = 0 or weekday(value) = 6)';
		h := AddItem('Sunday');
		ItemNonworkingUnits[h,OleVariant(False)] := 'weekday(value) = 0';
	end;
	EndUpdate();
end
1736
How can I specify the bar's caption to be caption from a column/cell

// Change event - Occurs when the user changes the cell's content.
procedure TForm1.G2antt1Change(ASender: TObject; Item : HITEM;ColIndex : Integer;var NewValue : OleVariant);
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	with Chart do
	begin
		FirstVisibleDate := '1/1/2001';
		PaneWidth[False] := 64;
		with Bars.Item['Task'] do
		begin
			Def[EXG2ANTTLib_TLB.exBarCaption] := '<fgcolor=808080><%=%C0%>';
			Def[EXG2ANTTLib_TLB.exBarHAlignCaption] := OleVariant(18);
		end;
	end;
	with (IUnknown(Columns.Add('Task')) as EXG2ANTTLib_TLB.Column).Editor do
	begin
		EditType := EXG2ANTTLib_TLB.DropDownListType;
		AddItem(1,'Aka',Null);
		AddItem(2,'Baka',Null);
		AddItem(3,'Taka',Null);
	end;
	with Items do
	begin
		AddBar(AddItem(OleVariant(1)),'Task','1/2/2001','1/5/2001',Null,Null);
		AddBar(AddItem(OleVariant(2)),'Task','1/3/2001','1/6/2001',Null,Null);
		AddBar(AddItem(OleVariant(3)),'Task','1/4/2001','1/7/2001',Null,Null);
	end;
	EndUpdate();
end
1735
The histogram values displayed on the chart are using 2 decimal places. Can this be formated to just 0 decimal place, so 86.79% becomes 87%

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Tasks');
	with (IUnknown(Columns.Add('Effort')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(21);
		Editor.EditType := EXG2ANTTLib_TLB.SpinType;
	end;
	with Chart do
	begin
		LevelCount := 2;
		NonworkingDays := 0;
		PaneWidth[False] := 96;
		FirstVisibleDate := '6/20/2005';
		HistogramVisible := True;
		HistogramHeight := 128;
		HistogramView := EXG2ANTTLib_TLB.exHistogramAllItems;
		with Bars.Item['Task'] do
		begin
			HistogramPattern := Pattern;
			HistogramType := EXG2ANTTLib_TLB.exHistOverload;
			HistogramCriticalValue := 3;
			ShowHistogramValues := 'value>3?255:1';
			HistogramItems := -11;
			HistogramGridLinesColor := $c0c0c0;
			HistogramRulerLinesColor := $10000;
			FormatHistogramValues := '(value format `0`) + ` units`';
		end;
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		h1 := AddItem('Task 1');
		AddBar(h1,'Task','6/21/2005','6/23/2005',Null,Null);
		CellValue[OleVariant(h1),OleVariant(1)] := OleVariant(6.79);
		h1 := AddItem('Task 2');
		AddBar(h1,'Task','6/24/2005','6/26/2005',Null,Null);
		CellValue[OleVariant(h1),OleVariant(1)] := OleVariant(3.19);
		h1 := AddItem('Task 3');
		AddBar(h1,'Task','6/27/2005','6/29/2005',Null,Null);
		CellValue[OleVariant(h1),OleVariant(1)] := OleVariant(2);
		h1 := AddItem('Task 4');
		AddBar(h1,'Task','6/30/2005','7/2/2005',Null,Null);
		CellValue[OleVariant(h1),OleVariant(1)] := OleVariant(1);
	end;
	EndUpdate();
end
1734
How can I create a relative time-scale

with G2antt1 do
begin
	BeginUpdate();
	DefaultItemHeight := 24;
	HeaderHeight := DefaultItemHeight;
	GridLineStyle := EXG2ANTTLib_TLB.exGridLinesSolid;
	DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
	LinesAtRoot := EXG2ANTTLib_TLB.exNoLinesAtRoot;
	BackColorLevelHeader := BackColor;
	with Chart do
	begin
		DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
		GridLineStyle := EXG2ANTTLib_TLB.exGridLinesSolid;
		PaneWidth[False] := 128;
		LevelCount := 2;
		FirstVisibleDate := OleVariant(0);
		NonworkingDays := 0;
		UnitWidth := 36;
		with Level[0] do
		begin
			Unit := EXG2ANTTLib_TLB.exDay;
			Count := 6;
			Alignment := EXG2ANTTLib_TLB.CenterAlignment;
			Label := '<%i%>';
			FormatLabel := '''<b>'' + ( (value / 6)  array (''Jan'',''Feb'',''Mar'',''Apr'',''May'',''Jun'',''Jul'',''Aug'',''Sep'',''Oct'',''Nov'',''Dec'') ) + ''-16''';
		end;
		with Level[1] do
		begin
			Label := '<%i%>';
			FormatLabel := '1 + value mod 6 + ` `';
			Alignment := EXG2ANTTLib_TLB.RightAlignment;
		end;
		AdjustLevelsToBase := True;
		ScrollRange[EXG2ANTTLib_TLB.exStartDate] := OleVariant(0);
		ScrollRange[EXG2ANTTLib_TLB.exEndDate] := OleVariant(95);
		with Bars.Item['Task'] do
		begin
			Height := 15;
			Color := $b4d5fc;
			Pattern := EXG2ANTTLib_TLB.exPatternSolid;
			Def[EXG2ANTTLib_TLB.exBarCaption] := 'date blocking';
		end;
	end;
	Columns.Add('Company');
	with Items do
	begin
		h := AddItem('ABC Company');
		ItemBackColor[h] := $f0f0f0;
		G2antt1.Chart.ItemBackColor[h] := $f0f0f0;
		hChild := InsertItem(h,Null,'line 1');
		AddBar(hChild,'Task',OleVariant(0),OleVariant(3),Null,Null);
		hChild := InsertItem(h,Null,'line 2');
		AddBar(hChild,'Task',OleVariant(3),OleVariant(5),'A',Null);
		AddBar(hChild,'Task',OleVariant(7),OleVariant(10),'B',Null);
		hChild := InsertItem(h,Null,'line 3');
		AddBar(hChild,'Task',OleVariant(5),OleVariant(8),'A',Null);
		AddBar(hChild,'Task',OleVariant(9),OleVariant(12),'B',Null);
		ExpandItem[h] := True;
	end;
	EndUpdate();
end
1733
Extending the bar's visual appearance with additional objects, EBNs, using the exBarBackgroundExt and exBarBackgroundExtInflate

with G2antt1 do
begin
	BeginUpdate();
	DefaultItemHeight := 32;
	with VisualAppearance do
	begin
		Add(1,'gBFLBCJwBAEHhEJAADhABcMIQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYED' + 
	'GHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NwXFaNZznBK7LpvK5HNrie55XzAcj3dbmAYJQzBJ' + 
	'LxKSIDwCd6NXrCOJ5HhWDzjQjJMozLC8YiPG6fZRbeT4ToGNdXYhJWiyLiFeYtVzSMj1fD9Ir/EakbLtey4Lq2A53RzdHThSQpCwPA4BgIA=');
		Add(2,'gBFLBCJwBAEHhEJAADhABcMIQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYED' + 
	'GHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NrXHZ9YwTOC5IDke67cr2J53XZAd4QTb2Cz7QC8Q' + 
	'AvDA7awafM1MSuHIcOw/AqTYDkTq4XjODYhTDEc4zPLcFx/I6haBoWCSLi+T5VVrRMo1TKtRxnNaubZqO5aRrGe5NW6EXThSQpCr+f4BgIA=');
		Add(3,'gBFLBCJwBAEHhEJAADhABcMIQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYED' + 
	'GHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NwXFaNZznBK7LpvK5HNrie55XxfV6YBa8B4JPaEZ' + 
	'LwLB7dwaf6IQLiWLYHiAAYZRKTcxlDI8AwvFaaZjnWA5ZaOMZBU7RNRyHR9IyTDaWaTqeqbHIuJ4FUzaNY2fZrOz2F6FAA6cKSFIWFYVAMBA');
		Add(4,'gBFLBCJwBAEHhEJAADhABb8IQAAYAQGKIYBkAKBQAGaAoDDUMQyQwAAyDAK8EwsACEIrAAJoaAAPoJRDGMTvfIgARIf6MIRAeCYFDAJQtDCMICwSKsXBaGwBJYGGaYED' + 
	'GHQATxKM7wGBcEyLDSgXZDQRAAoqTI/SICEIlAZJRjoOo5DJGGQmChkQhNVzGQzQSJFDTNAaEAwidDJCoOGgkBw7NwXFaNZznBK7LpvK5HNrie55XxfV6YBa8B4JPaEZ' + 
	'LwLB7dwaf6IQLiWLYHiAAYBIbJI5yeb5Hx3HqfZjbeSxVoML43SzHcByGRcTwzC6pYjrGoZJpWZ4ZQrbNR3DZ8VzzNTrQxIUhYVhUAkB');
		RenderType := -16777216;
	end;
	with Chart do
	begin
		PaneWidth[False] := 164;
		FirstVisibleDate := '1/1/2001';
		NonworkingDaysColor := $f0f0f0;
		NonworkingDaysPattern := EXG2ANTTLib_TLB.exPatternBDiagonal;
		with Bars.Item['Task'] do
		begin
			Height := 17;
			Color := $ffffff;
			Pattern := EXG2ANTTLib_TLB.exPatternSolid;
			Def[EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(1);
		end;
	end;
	Columns.Add('Column');
	with Items do
	begin
		AddBar(AddItem('Task'),'Task','1/2/2001','1/6/2001','',Null);
		h := AddItem('Task+Rhombus(red)');
		AddBar(h,'Task','1/2/2001','1/7/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(100%-11,50%-6,11,11),back=0x10000FF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := ',,5';
		h := AddItem('Rhombus(red)+Task');
		AddBar(h,'Task','1/2/2001','1/8/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(0,50%-6,11,11),back=0x10000FF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := '-5';
		h := AddItem('Task(yellow)+Rhombus(blue)');
		AddBar(h,'Task','1/2/2001','1/9/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(100%-11,50%-6,11,11),back=0x1FF0000]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := ',,5';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65535);
		h := AddItem('Rhombus(blue)+Task(yellow)');
		AddBar(h,'Task','1/2/2001','1/8/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(0,50%-6,11,11),back=0x1FF0000]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := '-5';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65535);
		h := AddItem('TriangleUp(white)+Task');
		AddBar(h,'Task','1/2/2001','1/7/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(0,50%-6,11,11),back=0x2FFFFFF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := '-5';
		h := AddItem('TriangleUp(blue)+Task(magenta)+TriangleDown(red)');
		AddBar(h,'Task','1/2/2001','1/6/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(0,50%-6,11,11),back=0x02FF0000],none[(100%-11,50%-6,11,11),back=0x030000FF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := '-5,0,5,0';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(16744703);
		h := AddItem('Rhombus+Task+TriangleDown');
		AddBar(h,'Task','1/2/2001','1/7/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(0,50%-6,11,11),back=0x01FF0000],none[(100%-11,50%-6,11,11),back=0x030000FF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := '-5, 0,5,0';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(16744448);
		h := AddItem('Rhombus+Task+TriangleDown');
		AddBar(h,'Task','1/2/2001','1/8/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(50%-6,0,11,11),back=0x01FF0000],none[(50%-6,100%-11,11,11),back=0x010000FF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := '0,-5,0,5';
		h := AddItem('Task+Star');
		AddBar(h,'Task','1/2/2001','1/9/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(100%-11,0,11,11),back=0x4FFFFFF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := OleVariant(5);
		h := AddItem('Star+Task');
		AddBar(h,'Task','1/2/2001','1/8/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(0,100%-11,11,11),back=0x04FFFFFF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := OleVariant(5);
		h := AddItem('Task+Star');
		AddBar(h,'Task','1/2/2001','1/7/2001','',Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExt] := 'none[(100%-11,0,11,11),back=0x4FFFFFF]';
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarBackgroundExtInflate] := '0,-6,14';
	end;
	EndUpdate();
end
1732
I am using the ItemBar(exBarFrameColor) to display an additional EBN on the current bar. The problem is that I still need a black frame around the bar. How can I achieve that

with G2antt1 do
begin
	BeginUpdate();
	with VisualAppearance do
	begin
		Add(1,'gBFLBCJwBAEHhEJAADhABXMIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EQLhGBRQCULQxDCBMIjLJoWhsASVRhnCBBRh' + 
	'wAI7ShPUBgXBNCQzICTJJkSJZBiECIJFAaJhnIapZDKGKQWCjAgiNpqGQ2QiKFC2HAcEAxCxGJBoKKZGq2bpJQLbdxUXRVZzpNi7Louay5CrOCZvXxaeAXDa+Az5ODDM' + 
	'RwLBcKhzCKDYzfdrZFaWFT3Qi8aCvG6sbw/HZ0OrEEIwCEBA');
		Add(2,'CP:1 0 0 5 0');
		Add(3,'gBFLBCJwBAEHhEJAADhABUEIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLIxhEYobgmGIaRiBMIxAKIZhzEgYRoiAYhXDiHwxARHUgRfIEOwHDiBZomWKZEi' + 
	'aKIqRrLMryFLMZx3CqcAApGaqHiOCYlSbTcoyfJYZBzD6mKJpWipWheW48U7PVRDJSkNysASZIyrGKqJouX4WR7BcZgNR4YBgEoWRouSBLWrgNIVR6/eBABZFPzbNK3Z' + 
	'zdOIIJgEgIA=');
		RenderType := -16777216;
	end;
	with Chart do
	begin
		PaneWidth[False] := 164;
		FirstVisibleDate := '1/1/2001';
		Bars.Item['Task'].Color := $3ff0000;
		Bars.Copy('Task','NewTask').Height := 15;
	end;
	Columns.Add('Column');
	with Items do
	begin
		h := AddItem('Task');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		AddBar(h,'NewTask','1/8/2001','1/12/2001','new',Null);
		h := AddItem('Task+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554432);
		AddBar(h,'NewTask','1/8/2001','1/12/2001','new',Null);
		ItemBar[h,'new',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554432);
		h := AddItem('Task/Color+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554687);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65280);
		AddBar(h,'NewTask','1/8/2001','1/12/2001','new',Null);
		ItemBar[h,'new',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554687);
		ItemBar[h,'new',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65280);
		h := AddItem('Task/Color+Rhombus/Color');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33619712);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(16711935);
		AddBar(h,'NewTask','1/8/2001','1/12/2001','new',Null);
		ItemBar[h,'new',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33619712);
		ItemBar[h,'new',EXG2ANTTLib_TLB.exBarColor] := OleVariant(16711935);
	end;
	EndUpdate();
end
1731
I am using EBN objects to show my bars, but when apply a color to the EBN looks darker. Is it possible to get the same color brightness

with G2antt1 do
begin
	BeginUpdate();
	with VisualAppearance do
	begin
		Add(1,'gBFLBCJwBAEHhEJAADhABWkIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EZBGABYJDUMAlCyNQBQSKIYxnAgYY4ACZ5Ij' + 
	'qAwLQjQEYzZI0SxJCqQZBBCCSQKkYx0HScRijDILBQwIQmaqjEZoJCiQZfQLCAYRMhkQx9DKTLRtKhYDqubpHUZbdwWRaVYTlM6RLbhGy7YqefJtXLfN4WZgWCz9QLDI' + 
	'4wS78JruaqOW5hVz4BasfTrOzLcTzG4HLhCCYBgI');
		Add(2,'CP:1 -6 0 0 0');
		RenderType := -16777216;
	end;
	with Chart do
	begin
		PaneWidth[False] := 164;
		FirstVisibleDate := '1/1/2001';
	end;
	Columns.Add('Column');
	with Items do
	begin
		h := AddItem('Task');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		h := AddItem('Task+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554432);
		h := AddItem('Task/Color+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554687);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65280);
		h := AddItem('Task/Color+Rhombus/Color');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33619712);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(16711935);
	end;
	EndUpdate();
end
1730
The ItemBar(exBarColor) changes the color for margins, and there is no exBarStartColor/exBarEndColor. However in my case I would then like do dynamically change the bar color to a different color without changing the start shape color

with G2antt1 do
begin
	BeginUpdate();
	with VisualAppearance do
	begin
		Add(1,'gBFLBCJwBAEHhEJAADhABWkIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EZBGABYJDUMAlCyNQBQSKIYxnAgYY4ACZ5Ij' + 
	'qAwLQjQEYzZI0SxJCqQZBBCCSQKkYx0HScRijDILBQwIQmaqjEZoJCiQZfQLCAYRMhkQx9DKTLRtKhYDqubpHUZbdwWRaVYTlM6RLbhGy7YqefJtXLfN4WZgWCz9QLDI' + 
	'4wS78JruaqOW5hVz4BasfTrOzLcTzG4HLhCCYBgI');
		Add(2,'CP:1 -6 0 0 0');
	end;
	with Chart do
	begin
		PaneWidth[False] := 164;
		FirstVisibleDate := '1/1/2001';
	end;
	Columns.Add('Column');
	with Items do
	begin
		h := AddItem('Task');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		h := AddItem('Task+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554432);
		h := AddItem('Task/Color+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554432);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65280);
		h := AddItem('Task/Color+Rhombus/Color');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33619712);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(16711935);
	end;
	EndUpdate();
end
1729
The ItemBar(exBarColor) changes the color for margins, and there is no exBarStartColor/exBarEndColor. However in my case I would then like do dynamically change the bar color to a different color without changing the end shape color

with G2antt1 do
begin
	BeginUpdate();
	with VisualAppearance do
	begin
		Add(1,'gBFLBCJwBAEHhEJAADhABXMIQAAYAQGKIYBkAKBQAGaAoDDWDoMAANAyjPBMKgBBCLAACaKQAD6CYQRhFT7yGAERr/C6EQLhGBRQCULQxDCBMIjLJoWhsASVRhnCBBRh' + 
	'wAI7ShPUBgXBNCQzICTJJkSJZBiECIJFAaJhnIapZDKGKQWCjAgiNpqGQ2QiKFC2HAcEAxCxGJBoKKZGq2bpJQLbdxUXRVZzpNi7Louay5CrOCZvXxaeAXDa+Az5ODDM' + 
	'RwLBcKhzCKDYzfdrZFaWFT3Qi8aCvG6sbw/HZ0OrEEIwCEBA');
		Add(2,'CP:1 0 0 6 0');
	end;
	with Chart do
	begin
		PaneWidth[False] := 164;
		FirstVisibleDate := '1/1/2001';
	end;
	Columns.Add('Column');
	with Items do
	begin
		h := AddItem('Task');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		h := AddItem('Task+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554432);
		h := AddItem('Task/Color+Rhombus');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33554432);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(65280);
		h := AddItem('Task/Color+Rhombus/Color');
		AddBar(h,'Task','1/2/2001','1/6/2001',Null,Null);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarFrameColor] := OleVariant(33619712);
		ItemBar[h,'',EXG2ANTTLib_TLB.exBarColor] := OleVariant(16711935);
	end;
	EndUpdate();
end
1728
Is it possible to resize a column with the mouse without changing the width of the next column

with G2antt1 do
begin
	BeginUpdate();
	ColumnAutoResize := False;
	(IUnknown(Columns.Add('Column 1')) as EXG2ANTTLib_TLB.Column).Width := 256;
	(IUnknown(Columns.Add('Column 2')) as EXG2ANTTLib_TLB.Column).Width := 512;
	DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
	EndUpdate();
end
1727
How can I align captions of items with checkbox, with items with no checkbox

with G2antt1 do
begin
	BeginUpdate();
	Columns.Add('Default');
	with Items do
	begin
		CellImages[OleVariant(AddItem(OleVariant(0))),OleVariant(0)] := '1';
		CellHasCheckBox[OleVariant(AddItem(OleVariant(1))),OleVariant(0)] := True;
		CellImages[OleVariant(AddItem(OleVariant(2))),OleVariant(0)] := '1';
	end;
	EndUpdate();
end
1726
How can I show each group header ( not-subroup ), with a different background color, while alternate background colors for inside items

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.PaneWidth[False] := 312;
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Items.AllowCellValueToItemBar := True;
	Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
	Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(0:= (1 rpos '''')) right ( ( 1:= ( =:0 rfind `.` ) ) != -1 ? =:1 : len(=:0))';
		Visible := False;
	end;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(1 rpos '''') contains ''.''';
		Visible := False;
	end;
	ConditionalFormats.Add('(%C13 mod 2) != 0',Null).BackColor := $f0f0f0;
	ConditionalFormats.Add('%C14 = 0',Null).BackColor := $bebebe;
	EndUpdate();
end
1725
What is the difference between %0 and %C0, when using in expressions ( format, conditional format, computed fields, and so on )

with G2antt1 do
begin
	BeginUpdate();
	Chart.PaneWidth[True] := 0;
	HeaderAppearance := EXG2ANTTLib_TLB.Etched;
	HeaderHeight := 24;
	ScrollBySingleLine := True;
	DrawGridLines := EXG2ANTTLib_TLB.exRowLines;
	(IUnknown(Columns.Add('Value')) as EXG2ANTTLib_TLB.Column).Def[EXG2ANTTLib_TLB.exCellValueFormat] := OleVariant(1);
	with (IUnknown(Columns.Add('FormatColumn = `%0` ~ CellValue')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '%0';
		Def[EXG2ANTTLib_TLB.exCellSingleLine] := OleVariant(False);
	end;
	with (IUnknown(Columns.Add('FormatColumn = `%C0`~ CellCaption')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '%C0';
		Def[EXG2ANTTLib_TLB.exCellSingleLine] := OleVariant(False);
	end;
	with Items do
	begin
		AddItem(OleVariant(1.1234));
		CellValueFormat[OleVariant(AddItem('<sha ;;0>This <fgcolor=FF0000>is a <s><b>HTM</fgcolor>L</b> text</s>.')),OleVariant(0)] := EXG2ANTTLib_TLB.exHTML;
		with CellEditor[OleVariant(AddItem(OleVariant(3))),Null] do
		begin
			EditType := EXG2ANTTLib_TLB.CheckListType;
			AddItem(1,'Border',Null);
			AddItem(2,'Thick',Null);
			AddItem(4,'Shadow',Null);
		end;
		FormatCell[OleVariant(AddItem(OleVariant(10000))),OleVariant(0)] := '`<b>` + currency(value)';
	end;
	EndUpdate();
end
1724
How can I alternate colors for each group header ( not-subroup ), with a different background color, while items of the same group showing with a different color

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.PaneWidth[False] := 312;
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Items.AllowCellValueToItemBar := True;
	Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
	Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(0:= (1 rpos '''')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))';
		Visible := False;
	end;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(1 rpos '''') contains ''.''';
		Visible := False;
	end;
	ConditionalFormats.Add('(%C13 mod 2) != 0',Null).BackColor := $f0f0f0;
	ConditionalFormats.Add('%C14 = 0',Null).BackColor := $bebebe;
	EndUpdate();
end
1723
How can I highlight each group header, with a different background color (method 2)

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			ItemBackColor[Item] := $bebebe;
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.PaneWidth[False] := 312;
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Items.AllowCellValueToItemBar := True;
	Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
	Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
end
1722
How can I highlight each group header ( not-subroup ), with a different background color (method 1)

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.PaneWidth[False] := 312;
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Items.AllowCellValueToItemBar := True;
	Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
	Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(0:= (1 rpos '''')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))';
		Visible := False;
	end;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(1 rpos '''') contains ''.''';
		Visible := False;
	end;
	ConditionalFormats.Add('%C14 = 0',Null).BackColor := $bebebe;
	EndUpdate();
end
1721
The BackColorAlternate displays each second row with a different background color. Is it possible to apply a different background color, for each sub-tree, ConditionalFormats, Add

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

// Sort event - Fired when the control sorts a column.
procedure TForm1.G2antt1Sort(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	LinesAtRoot := EXG2ANTTLib_TLB.exLinesAtRoot;
	with (IUnknown(Columns.Add('P1')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(True);
		PartialCheck := True;
	end;
	Chart.PaneWidth[True] := 0;
	with (IUnknown(Columns.Add('P2')) as EXG2ANTTLib_TLB.Column) do
	begin
		Def[EXG2ANTTLib_TLB.exCellHasCheckBox] := OleVariant(True);
		PartialCheck := True;
	end;
	with Items do
	begin
		h := AddItem('Root 1');
		InsertItem(h,Null,'Child 1');
		InsertItem(h,Null,'Child 2');
		ExpandItem[h] := True;
		h := AddItem('Root 2');
		InsertItem(h,Null,'Child 1');
		InsertItem(h,Null,'Child 2');
		ExpandItem[h] := True;
		h := AddItem('Root 2');
		InsertItem(h,Null,'Child 1');
		InsertItem(h,Null,'Child 2');
		ExpandItem[h] := True;
	end;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(0:= (1 rpos '''')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))';
		Visible := False;
	end;
	ConditionalFormats.Add('(%C2 mod 2) != 0',Null).BackColor := $f0f0f0;
	EndUpdate();
end
1720
The BackColorAlternate displays each second row with a different background color. Is it possible to apply a different background color, for 2nd, 3rd, 4th, row, and so on

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.PaneWidth[False] := 312;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Items.AllowCellValueToItemBar := True;
	Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
	Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '1 apos ''''';
		Visible := False;
	end;
	ConditionalFormats.Add('(%C13 mod 5) = 1',Null).BackColor := $808080;
	ConditionalFormats.Add('(%C13 mod 5) = 2',Null).BackColor := $a4a4a4;
	ConditionalFormats.Add('(%C13 mod 5) = 3',Null).BackColor := $bebebe;
	ConditionalFormats.Add('(%C13 mod 5) = 4',Null).BackColor := $f0f0f0;
	EndUpdate();
end
1719
The BackColorAlternate displays each second row with a different background color. The question I have it is possible to apply a different background color for 3rd, 4th, row, and so on

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.PaneWidth[False] := 312;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Items.AllowCellValueToItemBar := True;
	Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
	Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '1 apos ''''';
		Visible := False;
	end;
	ConditionalFormats.Add('(%C13 mod 4) = 0',Null).BackColor := $f0f0f0;
	EndUpdate();
end
1718
The BackColorAlternate looks fine for flat tables, but how about using it when displaying a hierarchy/tree, like grouping rows. The sample alternate colors for each group found

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		Refresh();
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	Chart.PaneWidth[False] := 312;
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	Items.AllowCellValueToItemBar := True;
	Columns.Item[OleVariant(2)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
	Columns.Item[OleVariant(4)].Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	with (IUnknown(Columns.Add('Position')) as EXG2ANTTLib_TLB.Column) do
	begin
		FormatColumn := '(0:= (1 rpos '''')) left ( ( 1:= ( =:0 lfind `.` ) ) != -1 ? =:1 : len(=:0))';
		Visible := False;
	end;
	ConditionalFormats.Add('(%C13 mod 2) != 0',Null).BackColor := $f0f0f0;
	EndUpdate();
end
1717
How do I show the chart's labels in 24-hour clock format

with G2antt1 do
begin
	with Chart do
	begin
		PaneWidth[False] := 0;
		FirstVisibleDate := '1/1/2001';
		LevelCount := 3;
		with Level[0] do
		begin
			Label := '<%mmm%> <%d%>, <%yyyy%>';
			Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment);
			Unit := EXG2ANTTLib_TLB.exDay;
		end;
		with Level[1] do
		begin
			Label := '<b><%h%>:00</b>';
			Alignment := EXG2ANTTLib_TLB.CenterAlignment;
			Unit := EXG2ANTTLib_TLB.exHour;
			DrawTickLines := EXG2ANTTLib_TLB.exLevelDefaultLine;
			DrawGridLines := True;
		end;
		with Level[2] do
		begin
			Label := '<%nn%>';
			Unit := EXG2ANTTLib_TLB.exMinute;
			Count := 15;
		end;
		ScrollTo('1/1/2001 8:30:00 AM',OleVariant(0));
	end;
end
1716
How do I show the chart's labels in 12-hour clock format

with G2antt1 do
begin
	with Chart do
	begin
		PaneWidth[False] := 0;
		FirstVisibleDate := '1/1/2001';
		LevelCount := 3;
		with Level[0] do
		begin
			Label := '<%mmm%> <%d%>, <%yyyy%>';
			Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment);
			Unit := EXG2ANTTLib_TLB.exDay;
		end;
		with Level[1] do
		begin
			Label := '<b><%h%>:00</b> <%AM/PM%>';
			Alignment := EXG2ANTTLib_TLB.CenterAlignment;
			Unit := EXG2ANTTLib_TLB.exHour;
			DrawTickLines := EXG2ANTTLib_TLB.exLevelDefaultLine;
			DrawGridLines := True;
		end;
		with Level[2] do
		begin
			Label := '<%nn%>';
			Unit := EXG2ANTTLib_TLB.exMinute;
			Count := 15;
		end;
		ScrollTo('1/1/2001 8:30:00 AM',OleVariant(0));
	end;
end
1715
I would like to avoid manual typing in the date-cell because user often type wrong things (no decimal points and so on) and so the todays-date is generated for the cell. What can be done

// KeyPress event - Occurs when the user presses and releases an ANSI key.
procedure TForm1.G2antt1KeyPress(ASender: TObject; var KeyAscii : Smallint);
begin
	with G2antt1 do
	begin
		OutputDebugString( 'if .Editying != 0 then' );
		OutputDebugString( Editing );
		KeyAscii := 0;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	with Columns do
	begin
		Add('Tasks');
		with (IUnknown(Add('Start')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(1);
			Editor.EditType := EXG2ANTTLib_TLB.DateType;
		end;
		with (IUnknown(Add('End')) as EXG2ANTTLib_TLB.Column) do
		begin
			Def[EXG2ANTTLib_TLB.exCellValueToItemBarProperty] := OleVariant(2);
			Editor.EditType := EXG2ANTTLib_TLB.DateType;
		end;
	end;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		AllowLinkBars := True;
		AllowCreateBar := EXG2ANTTLib_TLB.exNoCreateBar;
		LevelCount := 2;
		PaneWidth[False] := 196;
	end;
	with Items do
	begin
		AllowCellValueToItemBar := True;
		AddBar(AddItem('Task 1'),'Task','9/21/2006','9/24/2006',Null,Null);
		AddBar(AddItem('Task 2'),'Task','9/22/2006','9/25/2006',Null,Null);
		AddBar(AddItem('Task 3'),'Task','9/23/2006','9/26/2006',Null,Null);
	end;
	EndUpdate();
end
1714
When a Day, Week etc is clicked how can we make it centre/zoom the chart to cover all the bars

// OverviewZoom event - Occurs once the user selects a new time scale unit in the overview zoom area.
procedure TForm1.G2antt1OverviewZoom(ASender: TObject; );
begin
	with G2antt1 do
	begin
		with Chart do
		begin
			ScrollTo('1/1/2001',OleVariant(1));
			OutputDebugString( 'Start' );
			OutputDebugString( StartPrintDate );
			OutputDebugString( 'End' );
			OutputDebugString( EndPrintDate );
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
		AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
		Label[EXG2ANTTLib_TLB.exSecond] := '';
		Label[EXG2ANTTLib_TLB.exMinute] := '';
		Label[EXG2ANTTLib_TLB.exHour] := '';
		UnitScale := EXG2ANTTLib_TLB.exDay;
		ScrollTo('1/1/2001',OleVariant(1));
		MarkTimeZone('zone','1/1/2001','1/2/2001',OleVariant(10516548),Null);
	end;
	Columns.Add('Default');
	with Items do
	begin
		AddBar(AddItem('Item 1'),'Task','12/15/2000','1/10/2001',Null,Null);
		AddBar(AddItem('Item 2'),'Task','1/1/2001','1/5/2001',Null,Null);
	end;
	EndUpdate();
end
1713
The first time we run the application, the day label headers looks different then pressing Week and then Day again on the control's overview part. How do we make to show the header in the same format

with G2antt1 do
begin
	with Chart do
	begin
		PaneWidth[False] := 128;
		LevelCount := 2;
		OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
		AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
		Label[EXG2ANTTLib_TLB.exSecond] := '';
		Label[EXG2ANTTLib_TLB.exMinute] := '';
		Label[EXG2ANTTLib_TLB.exHour] := '';
		UnitScale := EXG2ANTTLib_TLB.exDay;
	end;
end
1712
How to sort numerically by columns

with G2antt1 do
begin
	BeginUpdate();
	(IUnknown(Columns.Add('Numeric')) as EXG2ANTTLib_TLB.Column).SortType := EXG2ANTTLib_TLB.SortNumeric;
	with Items do
	begin
		AddItem(OleVariant(1));
		AddItem(OleVariant(2));
		AddItem(OleVariant(12));
		AddItem(OleVariant(22));
	end;
	Columns.Item[OleVariant(0)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
end
1711
The control does not ensure the item to fit the control's client area once the user clicks the cell's button or check box. What can be done
// MouseDown event - Occurs when the user presses a mouse button.
procedure TForm1.G2antt1MouseDown(ASender: TObject; Button : Smallint;Shift : Smallint;X : Integer;Y : Integer);
begin
	// Items.EnsureVisibleItem(ItemFromPoint(-1,-1,c,hit))
end;

with G2antt1 do
begin
	BeginUpdate();
	TreeColumnIndex := -1;
	SelForeColor := ForeColor;
	with (IUnknown(Columns.Add('Buttons')) as EXG2ANTTLib_TLB.Column) do
	begin
		Alignment := EXG2ANTTLib_TLB.CenterAlignment;
		Def[EXG2ANTTLib_TLB.exCellHasButton] := OleVariant(True);
	end;
	with Items do
	begin
		AddItem('Button A');
		AddItem('Button B');
		AddItem('Button C');
	end;
	EndUpdate();
end
1710
How do I arrange the levels when the user changes the scale using the control's overview part

// OverviewZoom event - Occurs once the user selects a new time scale unit in the overview zoom area.
procedure TForm1.G2antt1OverviewZoom(ASender: TObject; );
begin
	with G2antt1 do
	begin
		OutputDebugString( Chart.UnitScale );
		EnsureVisibleColumn(OleVariant(0));
		with Chart do
		begin
			Level[0].DrawTickLines := EXG2ANTTLib_TLB.exLevelNoLine;
			ScrollTo('11/18/2015',OleVariant(1));
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	with Chart do
	begin
		FirstVisibleDate := '11/18/2015';
		PaneWidth[False] := 0;
		LevelCount := 2;
		DrawLevelSeparator := EXG2ANTTLib_TLB.exLevelSolidLine;
		with Level[0] do
		begin
			Alignment := Integer(EXG2ANTTLib_TLB.exHOutside) Or Integer(EXG2ANTTLib_TLB.CenterAlignment);
			DrawTickLines := EXG2ANTTLib_TLB.exLevelSolidLine;
			BackColor := G2antt1.BackColor;
		end;
		with Level[1] do
		begin
			DrawTickLines := Integer(EXG2ANTTLib_TLB.exLevelMiddleLine) Or Integer(EXG2ANTTLib_TLB.exLevelDotLine);
			DrawTickLinesFrom(0,EXG2ANTTLib_TLB.exLevelSolidLine);
		end;
		OverviewVisible := EXG2ANTTLib_TLB.exOverviewShowAllVisible;
		AllowOverviewZoom := EXG2ANTTLib_TLB.exAlwaysZoom;
		UnitWidth := 24;
		Label[EXG2ANTTLib_TLB.exSecond] := '';
		Label[EXG2ANTTLib_TLB.exMinute] := '';
		Label[EXG2ANTTLib_TLB.exHour] := '';
		Label[EXG2ANTTLib_TLB.exWeek] := '';
		Label[EXG2ANTTLib_TLB.exDay] := '<|><%d%><|><%d3%>, <%m3%> <%d%>, ''<%yy%><|><%dddd%>, <%mmmm%> <%d%>, <%yyyy%><||><||>4096';
		UnitScale := EXG2ANTTLib_TLB.exDay;
		ScrollTo(FirstVisibleDate,OleVariant(1));
	end;
	Columns.Add('Default');
	EndUpdate();
end
1709
I am using AllowGroupBy, the question is it is possible to add summary bars for child item, when user do grouping

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Summary',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
			DefineSummaryBars(Item,'',-3,'');
		end;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
end
1708
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 3)

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Chart.ShowCollapsedBars := True;
	EndUpdate();
	Layout := 'multiplesort="C1:1";collapse="0-9999"';
end
1707
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 2)

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
	BeginUpdate();
	EnsureVisibleColumn(OleVariant(0));
	Items.ExpandItem[0] := False;
	EndUpdate();
end
1706
I noticed that when grouping on a field, its details are always expanded. Is it possible to show collapsed by default (method 1)

// AddGroupItem event - Occurs after a new Group Item has been inserted to Items collection.
procedure TForm1.G2antt1AddGroupItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		Items.ExpandItem[Item] := False;
	end
end;

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
end
1705
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
	EnsureVisibleColumn(OleVariant(0));
	BeginUpdate();
	with Items do
	begin
		ExpandItem[RootItem[0]] := False;
		ExpandItem[RootItem[1]] := False;
		ExpandItem[RootItem[2]] := False;
	end;
	EndUpdate();
end
1704
Is there a possibility to expand / collapse all groups (or group by group) at runtime with a method (equivalent to pressing the + or - button in the group header)

// AddItem event - Occurs after a new Item has been inserted to Items collection.
procedure TForm1.G2antt1AddItem(ASender: TObject; Item : HITEM);
begin
	with G2antt1 do
	begin
		with Items do
		begin
			AddBar(Item,'Task',CellValue[OleVariant(Item),OleVariant(2)],CellValue[OleVariant(Item),OleVariant(4)],Null,Null);
		end;
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	Chart.FirstVisibleDate := '9/1/1994';
	BackColorSortBar := BackColor;
	ColumnAutoResize := False;
	rs := (IUnknown(ComObj.CreateComObject(ComObj.ProgIDToClassID('ADOR.Recordset'))) as ADODB_TLB.Recordset);
	with rs do
	begin
		Open('Orders','Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Program Files\Exontrol\ExG2antt\Sample\Access\misc.accdb',3,3,Null);
	end;
	DataSource := (IUnknown(rs) as ADODB_TLB.Recordset);
	SortBarVisible := True;
	SortBarCaption := 'Drag a <b>column</b> header here to group by that column.';
	AllowGroupBy := True;
	Columns.Item[OleVariant(1)].SortOrder := EXG2ANTTLib_TLB.SortAscending;
	EndUpdate();
	BeginUpdate();
	EnsureVisibleColumn(OleVariant(0));
	with Items do
	begin
		ExpandItem[FirstVisibleItem] := False;
	end;
	EndUpdate();
end
1703
How can I move automatically a bar once another is moved ( non-working bars )

with G2antt1 do
begin
	BeginUpdate();
	MarkSearchColumn := False;
	OnResizeControl := EXG2ANTTLib_TLB.exResizeChart;
	Columns.Add('Tasks');
	(IUnknown(Columns.Add('Start')) as EXG2ANTTLib_TLB.Column).Visible := False;
	(IUnknown(Columns.Add('End')) as EXG2ANTTLib_TLB.Column).Visible := False;
	with Chart do
	begin
		FirstVisibleDate := '9/20/2006';
		PaneWidth[False] := 64;
		with Bars.Add('Task:Split') do
		begin
			Shortcut := 'TSplit';
			Def[EXG2ANTTLib_TLB.exBarKeepWorkingCount] := OleVariant(True);
		end;
	end;
	with Items do
	begin
		h := AddItem('Project');
		CellValue[OleVariant(h),OleVariant(1)] := '9/22/2006';
		CellValue[OleVariant(h),OleVariant(2)] := '10/3/2006';
		AddBar(h,'Summary',CellValue[OleVariant(h),OleVariant(1)],CellValue[OleVariant(h),OleVariant(2)],Null,Null);
		h1 := InsertItem(h,Null,'Task 1');
		CellValue[OleVariant(h1),OleVariant(1)] := CellValue[OleVariant(h),OleVariant(1)];
		CellValue[OleVariant(h1),OleVariant(2)] := '9/26/2006';
		AddBar(h1,'TSplit',CellValue[OleVariant(h1),OleVariant(1)],CellValue[OleVariant(h1),OleVariant(2)],Null,Null);
		h2 := InsertItem(h,Null,'Task 2');
		CellValue[OleVariant(h2),OleVariant(1)] := CellValue[OleVariant(h1),OleVariant(2)];
		CellValue[OleVariant(h2),OleVariant(2)] := '9/28/2006';
		AddBar(h2,'TSplit',CellValue[OleVariant(h2),OleVariant(1)],CellValue[OleVariant(h2),OleVariant(2)],Null,Null);
		AddLink('L1',h1,'',h2,'');
		h3 := InsertItem(h,Null,'Task 3');
		CellValue[OleVariant(h3),OleVariant(1)] := CellValue[OleVariant(h2),OleVariant(2)];
		CellValue[OleVariant(h3),OleVariant(2)] := CellValue[OleVariant(h),OleVariant(2)];
		AddBar(h3,'TSplit',CellValue[OleVariant(h3),OleVariant(1)],CellValue[OleVariant(h3),OleVariant(2)],Null,Null);
		AddLink('L2',h2,'',h3,'');
		GroupBars(h1,'',False,h2,'',True,OleVariant(7),Null);
		GroupBars(h2,'',False,h3,'',True,OleVariant(7),Null);
		DefineSummaryBars(h,'',h1,'');
		DefineSummaryBars(h,'',h2,'');
		DefineSummaryBars(h,'',h3,'');
		ExpandItem[h] := True;
		ItemBold[h] := True;
	end;
	EndUpdate();
end
1702
How can I get notified once the user expands a column

// LayoutChanged event - Occurs when column's position or column's size is changed.
procedure TForm1.G2antt1LayoutChanged(ASender: TObject; );
begin
	with G2antt1 do
	begin
		OutputDebugString( 'Column-Expanded' );
		OutputDebugString( Columns.Item['C0'].Expanded );
	end
end;

with G2antt1 do
begin
	BeginUpdate();
	ShowFocusRect := False;
	ColumnAutoResize := False;
	DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
	BackColorLevelHeader := BackColor;
	with Columns do
	begin
		with (IUnknown(Add('C0')) as EXG2ANTTLib_TLB.Column) do
		begin
			ExpandColumns := '0,1,2';
			DisplayExpandButton := True;
		end;
		Add('C1');
		Add('C2');
	end;
	with Items do
	begin
		h := AddItem('Cell 0.0');
		CellValue[OleVariant(h),OleVariant(1)] := 'Cell 0.1';
		CellValue[OleVariant(h),OleVariant(2)] := 'Cell 0.2';
		h := AddItem('Cell 1.0');
		CellValue[OleVariant(h),OleVariant(1)] := 'Cell 1.1';
		CellValue[OleVariant(h),OleVariant(2)] := 'Cell 1.2';
	end;
	EndUpdate();
end
1701
I am using expandable headers, the question is how I can display the column itself, not just the child columns

with G2antt1 do
begin
	BeginUpdate();
	ColumnAutoResize := False;
	DrawGridLines := EXG2ANTTLib_TLB.exAllLines;
	BackColorLevelHeader := BackColor;
	with Columns do
	begin
		with (IUnknown(Add('C0')) as EXG2ANTTLib_TLB.Column) do
		begin
			ExpandColumns := '0,1,2';
			DisplayExpandButton := True;
		end;
		Add('C1');
		Add('C2');
	end;
	with Items do
	begin
		h := AddItem('Cell 0.0');
		CellValue[OleVariant(h),OleVariant(1)] := 'Cell 0.1';
		CellValue[OleVariant(h),OleVariant(2)] := 'Cell 0.2';
		h := AddItem('Cell 1.0');
		CellValue[OleVariant(h),OleVariant(1)] := 'Cell 1.1';
		CellValue[OleVariant(h),OleVariant(2)] := 'Cell 1.2';
	end;
	EndUpdate();
end